| From: | "Dave Cramer" <Dave(at)micro-automation(dot)net> |
|---|---|
| To: | "'Barry Lind'" <barry(at)xythos(dot)com>, <glos(at)gmx(dot)net> |
| Cc: | <pgsql-jdbc(at)postgresql(dot)org> |
| Subject: | Re: [INTERFACES] How to get oid of newly inserted row with JDBC? |
| Date: | 2002-01-14 20:40:09 |
| Message-ID: | 01dc01c19d3b$a89d7fd0$c201a8c0@inspiron |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-interfaces pgsql-jdbc |
You can cast the ResultSet to a org.postgresql.ResultSet and then call
getLastOID() to get the last inserted OID
Dave
-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Barry Lind
Sent: Monday, January 14, 2002 1:15 PM
To: glos(at)gmx(dot)net
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] [INTERFACES] How to get oid of newly inserted row
with JDBC?
This should be posted to the pgsql-jdbc mail list. Could you provide
some more details of your problem? A test case in java would help a
lot. There isn't enough information here for me to understand your
problem.
thanks,
--Barry
glos(at)gmx(dot)net wrote:
> Hello,
>
> I inserted a serialized object in a PostgreSQL database using jdbc.
> Now I want to get back the OID of the inserted object (to store in
> other database). How do I do that, because my ResultSet gives back
> 0/zero all the time.
>
> Thanx in advance.
> G.
>
>
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Siebert | 2002-01-14 22:50:25 | Notify |
| Previous Message | Barry Lind | 2002-01-14 18:15:29 | Re: [INTERFACES] How to get oid of newly inserted row with JDBC? |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ivan Manuel Andrade Muñoz | 2002-01-14 20:56:40 | HELP: Error opening connection to dburl: jdbc:postgresql://localhost/test |
| Previous Message | Jason Davies | 2002-01-14 20:11:39 | Re: Problem with getImportedKeys / getExportedKeys |