Re: JDBC and fetching the OID of an insert

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "Dave Cramer" <Dave(at)micro-automation(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC and fetching the OID of an insert
Date: 2002-09-18 14:21:17
Message-ID: 020601c25f1e$a7dde530$4201a8c0@beeblebrox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Dave Cramer wrote:

> There is or was actually a method in the driver ResultSet.getLastOID
> which allowed you to do this.You will have to cast the resultset into a
> AbstractJdbc(x)ResultSet, where x is the version; but Daryl's way is
> much better since oid's can wrap, and there is a possiblity that they
> don't exist ( you can turn them off in postgres).
>
> Dave

I don't really care that oid's can wrap. I don't need them as sequences.
Instead I was just looking for the easiest way to get a reference to the row
I just inserted.

So my considerations about getGeneratedKeys() would only work if oid's are
not turned off -- very bad for a driver...

Michael

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2002-09-18 14:23:53 Re: JDBC and fetching the OID of an insert
Previous Message Michael Paesold 2002-09-18 14:15:40 Re: JDBC and fetching the OID of an insert