Re: Further getLastOID() woes - Mailing list pgsql-jdbc

From Paul Thomas
Subject Re: Further getLastOID() woes
Date
Msg-id 20030901160513.A10691@bacon
Whole thread Raw
In response to Re: Further getLastOID() woes  (Zak McGregor <zak@mighty.co.za>)
Responses Re: Further getLastOID() woes  (Zak McGregor <zak@mighty.co.za>)
List pgsql-jdbc
On 01/09/2003 15:28 Zak McGregor wrote:
> On Mon, 1 Sep 2003 06:27:20 -0400 (EDT)
> Kris Jurka <books@ejurka.com> wrote:
>
> > You must either import org.postgresql.jdbc1 or include the full
> > package/class name in your cast.
>
> Thanks, but it isn't that. Anything else I can try?
>
> [zak@zak celerity]$ javac -classpath .:jdbc7.1-1.2.jar DBase.java
> DBase.java:81: cannot resolve symbol
> symbol  : class AbstractJdbc2Statement
> location: package postgresql
>             return
> ((org.postgresql.AbstractJdbc2Statement)(stmt)).getLastOID()
> ;
>

Looking at the sources for the 7.1 JDBC driver, it looks like you should
be saying something like:

return ((org.postgresql.jdbc1.Statement)(stmt).getInsertedOID();

Later drivers would seem to use the format you've just tried. I think the
later drivers will work OK with Postgres 7.1 (I assume that's what you're
using).

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Further getLastOID() woes
Next
From: Zak McGregor
Date:
Subject: Re: Further getLastOID() woes