Re: getGeneratedKeys()

From: Kris Jurka <books(at)ejurka(dot)com>
To: <henr-and(at)dsv(dot)su(dot)se>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: getGeneratedKeys()
Date: 2003-12-31 02:38:51
Message-ID: Pine.LNX.4.33.0312302132390.18760-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 30 Dec 2003 henr-and(at)dsv(dot)su(dot)se wrote:

>
> > This method has not been implemented and most likely will not be
> > implemented anytime soon. First it is unclear to me what it means by
> > auto-generated keys. Does it mean just things like serial or anything
> > that a before insert trigger does to modify the row?
>
> In my case it's a serial. I want to get the id-number that my insert
> generates.
> MySQL's JDBC-driver has implemented the method.
>

They have implemented the method, but they have not answered any of the
questions I have raised. Their getGeneratedKeys call just wraps
getLastInsertID(). This would be the equivalent of us providing a currval
like function that didn't take a sequence argument. It is largely useless
in the face of after insert triggers calling another sequence's nextval
and tables with multiple serial columns. This doesn't even get into the
before trigger case.

Also with mysql's timestamp type auto-updating itself, shouldn't that be
returned as well?

Does anyone know of any documention other than the API javadoc? The
DatabaseMetaData functions that return ResultSets list the columns and
their contents, but this Statement function does no such thing.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message John Sidney-Woollett 2003-12-31 07:53:20 Re: getGeneratedKeys()
Previous Message henr-and 2003-12-31 00:08:14 Re: getGeneratedKeys()