#1296 Jdbc Batch Selects doesn't work

jdbc (172)

When executing a batch of select queries, HSQLDB 2.2.9 reports an error:
"java.sql.SQLException: statement does not generate a row count"

The problem can be reproduced with the Junit Test in the attachment, or with the


  • Philippe Bougrier

    Jdbc Statement.executeBatch() states that queries not returning rows affected returns "SUCCESS_NO_INFO". Thus, I was expecting that select queries can be batched.

  • Fred Toussi

    Fred Toussi - 2013-04-12

    Batch statements are for INSERT and UPDATE, and possibly other statements that modify the data.

    getMoreResults() is used with non-batched statements that return multiple ResultSet objects. These are calls to stored procedure that return several results.

    The JavaDoc for Java 6 and later adds the following clarification for addBatch():
    Parameters: sql - typically this is a SQL INSERT or UPDATE statement (:JDBC4 modified)

  • Fred Toussi

    Fred Toussi - 2013-04-12
    • assigned_to: nobody --> fredt
    • priority: 5 --> 1
    • status: open --> closed-invalid

Log in to post a comment.