Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-02-01 Thread William Speirs
I'll take a look when I can, but more unit tests and docs are always welcome :-) Thanks... Bill- On Feb 1, 2012 3:43 AM, "Simone Tripodi" wrote: > > Thanks! I should be able to make some time to make any necessary changes, > > like adding JavaDoc, a few more unit tests, etc. > > > > Moandji > >

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-02-01 Thread Simone Tripodi
> Thanks! I should be able to make some time to make any necessary changes, > like adding JavaDoc, a few more unit tests, etc. > > Moandji thanks, that would be really appreciated! best, -Simo http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simone

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-02-01 Thread Moandji Ezana
Hi Simone, On Wed, Feb 1, 2012 at 9:24 AM, Simone Tripodi wrote: > I had a quick look at the patch and IMHO it looks good. I assigned the > issue to Bill who's more deep inside DbUtils than me :) > > All the best and thanks for contributing! > Thanks! I should be able to make some time to make a

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-01-31 Thread Simone Tripodi
Hi Moandji, I had a quick look at the patch and IMHO it looks good. I assigned the issue to Bill who's more deep inside DbUtils than me :) All the best and thanks for contributing! -Simo http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simonetripo

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-01-31 Thread Moandji Ezana
On Sun, Jan 29, 2012 at 6:21 PM, William Speirs wrote: > Interesting... would you be willing to donate your QueryRunner > implementation? If so, open a JIRA ticket[1] with your request for this > functionality, and upload your code. > Done, with embryonic patch: https://issues.apache.org/jira/b

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-01-29 Thread Moandji Ezana
I don't mind, but it's a very limited implementation. I don't know if it's abywhere near general-purpose for your needs. I'll post it and let you decide. Moandji On 29 Jan 2012 18:21, "William Speirs" wrote: > Interesting... would you be willing to donate your QueryRunner > implementation? If s

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-01-29 Thread William Speirs
Interesting... would you be willing to donate your QueryRunner implementation? If so, open a JIRA ticket[1] with your request for this functionality, and upload your code. Thanks... Bill- [1] https://issues.apache.org/jira/browse/DBUTILS On Sun, Jan 29, 2012 at 11:19 AM, Moandji Ezana wrote:

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-01-29 Thread Moandji Ezana
On Sun, Jan 29, 2012 at 6: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 D

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-01-29 Thread Simone Tripodi
Hi Bill, we could manage at least the generated keys, using Statement#getGeneratedKeys()[1], requiring a non null ResultSetHandler. To not break APIs backward compatibility, that could be a new set of APIs... WDYT? best, -Simo [1] http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html

Re: [DbUtils] Returning the newly-generated primary key after an insert

2012-01-29 Thread William Speirs
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 t

[DbUtils] Returning the newly-generated primary key after an insert

2012-01-29 Thread Moandji Ezana
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