Re: Problems with getGeneratedKeys();
Posted by: Tetsuro Ikeda
Date: May 31, 2005 03:16AM

Hi Isabelle,

> I try to get the primarykey, which is auto
> incremented, after an executeUpdate, but the
> ResultSet is empty although the row is well
> included.
> I don't understand why.
> Could someone help me please ...

Are you using getGeneratedKeys() after the UPDATE statement?
If you so, the method returns the empty ResultSet.

Or, if you use getGeneratedkeys() after the INSERT statment,
you can get the non-empty ResultSet like the sample code I posted.

This is defined by JDBC Specification.
http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html#getGeneratedKeys()

Tetsuro IKEDA

Options: ReplyQuote


Subject
Written By
Posted
Re: Problems with getGeneratedKeys();
May 31, 2005 03:16AM


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.