Re: preparedStatement.getGeneratedKeys() exception.
Posted by: Mark Matthews
Date: November 04, 2004 08:19PM

You're making things too complex ;)

If you're usng an updatable result set, just make sure the primary key is part of your select...When you create an updatable result set, when you use ResultSet.insertRow(), the driver will automatically populate the value for you, then you just call ResultSet.getInt() on the updatable result row's primary key column.

However, with your code, I still think you're confused about how to utilize an UpdatableResultSet, since I don't see you actually trying to create one with your example code.

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.