db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Marr" <stefan.m...@web.de>
Subject RE: Statment.getGeneratedKeys not implemented? or how to use it?
Date Mon, 04 Apr 2005 16:10:50 GMT
Hi Craig,

thx a lot. Your hint leads me in the right direction.

A genIds.next() was missing.

Now everything works like a charm.

Kind Regards
Stefan


> -----Urspr√ľngliche Nachricht-----
> Von: derby-user-return-1114-stefan.marr=web.de@db.apache.org
> [mailto:derby-user-return-1114-stefan.marr=web.de@db.apache.org] Im
> Auftrag von Craig Russell
> Gesendet: Montag, 4. April 2005 17:37
> An: Derby Discussion
> Betreff: Re: Statment.getGeneratedKeys not implemented? or how to use it?
> 
> Hi Stefan,
> 
> After researching the javadoc on Statement, I think I've found the
> culprit. It's nothing to do with the Statement, it's with the
> ResultSet.
> 
> ResultSet columns are 1-origin not the normal Java 0-origin. Try:
> 
> > genIds = stmt.getGeneratedKeys();
> > modifiedId = genIds.getInt(1); // 1-origin
> 
> Craig



Mime
View raw message