Re: Problem with PGStatement.getLastOID()

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: ListMan <listman(at)cybermaccara(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Problem with PGStatement.getLastOID()
Date: 2003-12-01 23:37:03
Message-ID: 1070321823.1636.159.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Have to agree with Oliver, this is some weird classpath issue, ie
building with one library, running with another?

I just added a test case into MiscTest.java and it runs fine.

Dave
On Mon, 2003-12-01 at 17:50, ListMan wrote:
> Hi!
>
> I hope you can help me with a problem with the jdbc-driver devel version
> (need it for 7.4).
>
> With driver version pg73jdbc the following works fine:
>
> int rowCount = -1;
> long insertedOid = -1;
> Connection con = null;
> Statement stmt = null;
>
> con = sec.getConnection(); // gets pooled connection
> stmt = con.createStatement();
> con.setAutoCommit(false);
> rowCount = stmt.executeUpdate(query);
> con.commit();
> insertedOid = ((org.postgresql.PGStatement)stmt).getLastOID();
> con.setAutoCommit(true);
> con.close();
>
> With devel version I get ClassCastException on row with insertedOid =
> ((org.postgresql.PGStatement)stmt).getLastOID();
>
> Version 73 drivers were tested against our production server which is
> running postgres 7.3 and devel drivers were tested against my own own
> machine running 7.4 on Cygwin.
>
> I hope you can help me with this.
>
> B Rgds,
> JariP
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message ListMan 2003-12-02 00:23:21 Re: Problem with PGStatement.getLastOID()
Previous Message Oliver Jowett 2003-12-01 23:25:28 Re: Problem with PGStatement.getLastOID()