For H2, the statement "CALL" actually does return a result set. So I
wouldn't call it a 'bug'. However, it might be incompatible with other
databases. With which other database do you compare this?
Regards,
Thomas
execute
method executes an SQL
statement and indicates the form of the first result. You must then
use the methods getResultSet
or getUpdateCount
to retrieve the result, and getMoreResults
to move to
any subsequent result(s).
Returns: true
if the next result is a ResultSet
object; false
if it is an update count or there are no
more results, so a standard way to process a request would be:
> I'm sure its a bug.
In your view, yes, and I understand your view. My previous boss once
said the definition of a bug is: it's where the documentation and the
implementation don't match. In H2 it is not documented that the CALL
statement returns a result set at
http://h2database.com/html/grammar.html#call - but the CALL statement
always did return a result set (with one row, or with many rows).
Changing this behavior would probably break existing applications that
rely on this current behavior.
For H2, you can still use CallableStatement, call c.execute(), and
then call c.getInt().
I understand the behavior of H2 doesn't match the behavior of other
databases, but I'm afraid it's not something that I can change
currently. I will add a feature request, and patches are welcome of
course.
Regards,
Thomas
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database.
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
For more options, visit https://groups.google.com/groups/opt_out.
So yes, right now, you can't use CallableStatement.executeUpdate() with the SQL statement of type "call".
--