Skip site navigation (1) Skip section navigation (2)

getting primary key values for inserted records?

From: Guido Fiala <guido(dot)fiala(at)dka-gmbh(dot)de>
To: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: getting primary key values for inserted records?
Date: 2004-01-27 13:17:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

I'am currently at the point, that after i insert a new Record in a ResultSet 
using insertRow() and using a serial for the primary key of the target table.

Of course i do not call rs.updateInt(primaryKey), as the sequence does get me 
the new value automatically.

However - even using rs.refreshRow() doesn't get me the values, just a requery 
of the ResultSet.

What is the way to go here?



pgsql-jdbc by date

Next:From: sandrine wamy wapetDate: 2004-01-27 15:10:30
Subject: Re: Connection problem
Previous:From: Kris JurkaDate: 2004-01-27 08:45:26
Subject: Re: Patch to readd documentation

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group