hmm, the getGeneratedKeys() is new in
java 1.4; it could be your
JDBC driver does not really implement this completely or properly yet.
It may be that this feature does not work with prepared statements ?
I was going to say to try to use the alternate signature for executeUpdate:
int executeUpdate(
String sql,
int autoGeneratedKeys)
throws SQLException
the jdbc API docs say :
autoGeneratedKeys - a flag indicating whether auto-generated keys should be made available for retrieval; one of the following constants: Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYS
it could be your JDBC driver implementation uis by default not making the generated keys available when the executeUpdate() is called.
but that you need to pass it a query string, which defeats the good of using prepared statements.
hmmm...
would it be possible to have a mthod that invokes a sequence, or generates the keys, then you would pass that value into your insert statement:
hmm, the getGeneratedKeys() is new in java 1.4; it could be your JDBC driver does not really implement this completely or properly yet.
It may be that this feature does not work with prepared statements ?
I was going to say to try to use the alternate signature for executeUpdate:
int executeUpdate(String sql,
int autoGeneratedKeys)
throws SQLException
the jdbc API docs say :
autoGeneratedKeys - a flag indicating whether auto-generated keys should be made available for retrieval; one of the following constants: Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYS
it could be your JDBC driver implementation uis by default not making the generated keys available when the executeUpdate() is called.
but that you need to pass it a query string, which defeats the good of using prepared statements.
hmmm...
would it be possible to have a mthod that invokes a sequence, or generates the keys, then you would pass that value into your insert statement: