Received: from p1.selectacast.net (IDENT:root@p1.selectacast.net [206.41.1.251]) by hub.org (8.10.1/8.10.1) with ESMTP id e6IJ0bh70492 for ; Tue, 18 Jul 2000 15:00:37 -0400 (EDT) Received: from selectacast.net (IDENT:jks@d1 [209.219.91.66]) by p1.selectacast.net (8.9.3/8.9.3) with ESMTP id PAA16214; Tue, 18 Jul 2000 15:00:35 -0400 Message-ID: <3974A953.92FF9DD2@selectacast.net> Date: Tue, 18 Jul 2000 15:00:35 -0400 From: Joseph Shraibman Organization: Xtenit X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.15 i686) X-Accept-Language: en MIME-Version: 1.0 To: John Thorhauer CC: pgsql-interfaces@postgresql.org Subject: Re: jdbc how to get SERIAL References: <3974A3B0.E4D01DED@phoenixcolor.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200007/124 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@phoenixcolor.com > ********************************