Re: Retrieve auto-generated key.

Поиск
Список
Период
Сортировка
От Alexander Panzhin
Тема Re: Retrieve auto-generated key.
Дата
Msg-id 4910CFCF.10703@gmail.com
обсуждение исходный текст
Ответ на Retrieve auto-generated key.  ("Sangeeta" <Sangeeta.shah@bluenog.com>)
Список pgsql-jdbc
If you want an easy solution(and a bit more portable), you probably are
better off with doing a "SELECT lastval()"
Though an insert trigger inserting into another table with a serial
column might screw up the result.

See http://www.postgresql.org/docs/8.3/interactive/functions-sequence.html


> Hi
>
>
>
> Ability to retrieve auto-generated key is one of the key features of
> JDBC3.
> I tried using prepareStatement(String sql, int autoGeneratedKeys) ,
> prepareStatement(String sql, int[] columnIndexes) and
> prepareStatement(String sql, String[] columnNames) but with no success
> . It returned with exception message as "Returning autogenerated keys
> is not supported."
>
>
>
> I know there is already one thread for retrieve auto-generated key but
> look like that thread does not have one distinct   solution.
>
> Is there any patch or workaround to retrieve auto-generated key ?
>
>
>
>
>
> Thanks
>
> Sangeeta
>


Вложения

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

Предыдущее
От: "gcj"
Дата:
Сообщение: Re: Retrieve auto-generated key.
Следующее
От: "Christophe Janton"
Дата:
Сообщение: Bug report (with solution) on org.postgresql.jdbc2.EscapedFunctions