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: 200401271417.43767.guido.fiala@dka-gmbh.de (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hallo,

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?

Guido

Responses

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-2014 The PostgreSQL Global Development Group