JDBC and fetching the OID of an insert

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: JDBC and fetching the OID of an insert
Date: 2002-09-18 13:36:34
Message-ID: 01e601c25f18$68f49b30$4201a8c0@beeblebrox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Daryl Beattie 2002-09-18 13:53:44 Re: JDBC and fetching the OID of an insert
Previous Message Bruce Momjian 2002-09-18 05:01:14 Re: Patch for handling "autocommit=false" in postgresql.conf