commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <>
Subject Re: [DbUtils] Returning the newly-generated primary key after an insert
Date Sun, 29 Jan 2012 16:14:03 GMT
Hi Bill,

we could manage at least the generated keys, using
Statement#getGeneratedKeys()[1], requiring a non null
To not break APIs backward compatibility, that could be a new set of APIs...



On Sun, Jan 29, 2012 at 5:05 PM, William Speirs <> wrote:
> That is a question more specific to the database you're using, than
> DBUtils. For some databases this means writing a stored procedure which
> performs the insert, and then a special select to get the primary key. You
> can of course use DBUtils to call this stored proc and read the primary key.
> Hope this helps...
> Bill-
> On Sun, Jan 29, 2012 at 9:44 AM, Moandji Ezana <> wrote:
>> Is it possible with the current API to do an insert and get back the
>> generated primary key, rather than the number of affected rows?
>> Best regards,
>> Moandji

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message