JDBC and fetching the OID of an insert - Mailing list pgsql-jdbc

From Michael Paesold
Subject JDBC and fetching the OID of an insert
Date
Msg-id 01e601c25f18$68f49b30$4201a8c0@beeblebrox
Whole thread Raw
In response to JDBC API Tests  (Al Sutton <al@alsutton.com>)
Responses Re: JDBC and fetching the OID of an insert  (Dave Cramer <Dave@micro-automation.net>)
List pgsql-jdbc
Hi,

Does anyone of you know, how to get the OID of the just inserted Row after
stmt.executeUpdate("INSERT... ")? I hope this is possible at all!

If it's not, I would be willing to implement getGeneratedKeys() to return at
least the OID of an insert. Assuming that would be possible and exceptable?

(Btw. am I correct that the only way to get a value for a sequence via JDBC
is to "SELECT currval('...')" resp. "SELECT nextval('...')"?)


Best Regards,
Michael


pgsql-jdbc by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Patch for handling "autocommit=false" in postgresql.conf
Next
From: Daryl Beattie
Date:
Subject: Re: JDBC and fetching the OID of an insert