Re: jdbc how to get SERIAL

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: John Thorhauer <jthorhauer(at)phoenixcolor(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: jdbc how to get SERIAL
Date: 2000-07-18 19:00:35
Message-ID: 3974A953.92FF9DD2@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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("insert into 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(at)phoenixcolor(dot)com
> ********************************

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Matt Fair 2000-07-18 19:02:46 Re: Connection.setBytes()
Previous Message Joachim Achtzehnter 2000-07-18 18:54:37 Re: Connection.setBytes()