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
Test case for reproduce the problem
Jdbc Statement.executeBatch() states that queries not returning rows affected returns "SUCCESS_NO_INFO". Thus, I was expecting that select queries can be batched.
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)
Log in to post a comment.