tmp@nitwit.de wrote:
> And why doesn't this work:
>
> db.setAutoCommit(false);
>
> final Statement select =
> db.createStatement(ResultSet.HOLD_CURSORS_OVER_COMMIT,
> ResultSet.CONCUR_READ_ONLY);
You are passing the wrong constants here. The first argument to
createStatement should be the resultset type constant (ResultSet.TYPE_*)
not a cursor holdability constant.
You probably meant:
final Statement select = db.createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
The current driver will throw an exception if you try this, as
HOLD_CURSORS_OVER_COMMIT is not supported (actually, it throws in *all*
cases if you use the three-arg createStatement method -- I have that
fixed in my tree)
I note that the current driver returns true from
DatabaseMetadata.supportsResultSetHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT)
which is wrong.
-O