Re: jdbc how to get SERIAL

Поиск
Список
Период
Сортировка
От Joseph Shraibman
Тема Re: jdbc how to get SERIAL
Дата
Msg-id 3974A953.92FF9DD2@selectacast.net
обсуждение исходный текст
Ответ на jdbc how to get SERIAL  (John Thorhauer <jthorhauer@phoenixcolor.com>)
Список pgsql-interfaces
Explictly get the value.

For example:
ResultSet rs = st.executeQuery("select nextval('my_col_name_seq'));st.next(); int id =
st.getInt(1);st.executeUpdate("insertinto mytable values(id = "+id+" , myvalu =
 
'blah');");

John Thorhauer wrote:
> 
> How do I get the id column of a row via jdbc if the column is a SERIAL
> column.  I want to get the id of the row after I insert new data via
> jdbc execute command.
> 
> Thanks,
> John Thorhauer
> 
> --
> ********************************
> ** John Thorhauer
> ** jthorhauer@phoenixcolor.com
> ********************************


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

Предыдущее
От: Joachim Achtzehnter
Дата:
Сообщение: Re: Connection.setBytes()
Следующее
От: Matt Fair
Дата:
Сообщение: Re: Connection.setBytes()