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

Re: Support of getting generated keys in driver version 8.4devel

From: Kris Jurka <books(at)ejurka(dot)com>
To: Miłosz Tylenda <mtylenda(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Support of getting generated keys in driver version 8.4devel
Date: 2008-12-31 19:29:51
Message-ID: Pine.BSO.4.64.0812311423300.10458@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

On Wed, 31 Dec 2008, Mi³osz Tylenda wrote:

> I am looking for getting generated keys support in the driver. The
> changelog says it has basic generated keys support. However,
> DatabaseMetaData.supportsGetGeneratedKeys() returns false

I intentionally left supportsGetGeneratedKeys false because we don't 
support returning generated keys by column indexes.  Without knowing how 
used that method is, I'm not sure if this is more or less helpful.  I'm 
open to input if people think we should change it to true.

> and when I execute:
>
> con.prepareStatement("insert into tab0 values(default, 444)", new
> String[] {"id"});
>
> I am receiving:
>
> Caused by: org.postgresql.util.PSQLException: Returning autogenerated
> keys is not supported.

This was an oversight on my part.  I added support for the Statement 
methods, but somehow not for PreparedStatement methods.  Shouldn't be too 
tough to add, let me take a look and get back to you in a day or two.

Kris Jurka

In response to

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2008-12-31 19:31:58
Subject: Re: Trying to insert an array using a prepared statement.
Previous:From: Miłosz TylendaDate: 2008-12-31 12:19:23
Subject: Support of getting generated keys in driver version 8.4devel

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