Problem with PGStatement.getLastOID()

Поиск
Список
Период
Сортировка
От ListMan
Тема Problem with PGStatement.getLastOID()
Дата
Msg-id 6.0.1.1.0.20031202003503.01cb8998@tuta.hut.fi
обсуждение исходный текст
Ответы Re: Problem with PGStatement.getLastOID()  (Oliver Jowett <oliver@opencloud.com>)
Re: Problem with PGStatement.getLastOID()  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-jdbc
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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: groups@ezotyrik.org (Ezotyrik)
Дата:
Сообщение: Backend Protocol Examples?
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Problem with PGStatement.getLastOID()