|Subject||Re: [Firebird-Java] Getting back auto-generated primary key...|
> What I need to do, is when I create a new record, I need to knowThe problem is not the driver, but the database server - there is no chance
> what the primary key of this newly created record is. I've tried
> with the getGeneratedKeys method of the PreparedStatement this is
> there for this reason, but it seem that this method as not been
> implemented in the latest version of the JDBC driver.
to get it back.
> What should I use to get back this value?No change. You have to get the value first with SELECT gen_id(my_generator,
1) FROM rdb$database and then set that value in the INSERT statement. You
can optimize the database calls by fetching a block of IDs with, for
example, gen_id(my_generator, 100) and then increment them in your
> I really need a solution for this problem.That's the only solution available at present time. But please post a
feature request either to firebird-support or firebird-devel list. The more
often people request that feature, the more probable is that it will be