Re: preparedStatement.getGeneratedKeys() exception.
Posted by: Alex Cheung
Date: November 05, 2004 11:13AM

I am not trying to update a row, I am trying to insert a row and get the auto-gen-key back for the newly inserted row via getGeneratedKeys() after the pstmt.execute() is called.

In this case I inserted a new row for dp_objtype and expect to get the objtypeid back in the ResultSet of getGeneratedKeys().

Maybe my question is not to expect to use the updateable resultset, but why did pstmt.execute() expect an updateable resultset when the Connection.preparedStatement(string, return_auto_genkey) is used. When I use pstmt returned from Connection.preparedStatement(string), things work; but I cannot get the generated key.


Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.