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

Alex,

The only way I've been able to provoke a NullPointerException (which I should actually throw a SQLException in this case) is if you're calling getGeneratedKeys() _before_ you call execute().

Is this the case with your code? If so, the error is in your code, you're not supposed to call .getGeneratedKeys() until after you've executed the statement.

If not, you'll need to provide more of a testcase, because I can't duplicate the error with what you've shown here :(

-Mark

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.