Обсуждение: getGeneratedKeys() support?

Поиск
Список
Период
Сортировка

getGeneratedKeys() support?

От
Benjamin Shive
Дата:
I went through the archive and did see the discussions earlier this
year on adding support for this feature. I use pgsql for my own
projects, but the lack of support for this method is making it harder
to use with other products that are out there. Has there been any
further progress made recently on getting this added? I'd rather keep
using PGpgsql as much as possible (and able to recommend it to others).

http://archives.postgresql.org/pgsql-jdbc/2007-03/msg00090.php
http://archives.postgresql.org/pgsql-jdbc/2007-02/msg00078.php


Re: getGeneratedKeys() support?

От
Andrew Lazarus
Дата:
The current JDBC driver supports the RETURNING clause and it does
exactly what someone would want.

ResultSet rs = statement.executeQuery("INSERT INTO z(myField) VALUES(0)
RETURNING keyName") ;
int key = rs.getInt(1);

Hallelujah