How to get generated primary key?

From: Sven Köhler <skoehler(at)upb(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: How to get generated primary key?
Date: 2005-02-19 17:15:54
Message-ID: cv7rtb$1d6$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

i know about the nextval and currval functions, but i don't like them,
since they don't apply to tables. To get the generated key, you have to
know the name of the sequence, not just the name of the table.

Does the JDBC-Driver implement the getGeneratedKeys() method?
If not, does PostgreSQL provide any way to get the just generated key,
without knowing the sequencename?

Thx
Sven

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sven Köhler 2005-02-19 17:40:58 Re: getGeneratedKeys method
Previous Message peter royal 2005-02-19 14:02:52 Re: DatabaseMetaData.getIndexInfo and function-based indexes