commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <>
Subject Re: [DbUtils] Retrieving Auto Generated Keys
Date Wed, 02 Jun 2004 02:46:27 GMT

--- Mikhail Krivoshein <> wrote:

>I dislike idea to implement independant set of query methods named 
>insert because JDBC doesn't do that.
>And unfornutatly there is no way to implement Object 
>getGeneratedKeys(ResultSetHandler rsh) because
>update closes statement object.

Passing a ResultSetHandler into the update() methods to deal with primary
keys seems reasonable.

>Looking forward for comments.
>Also I'd like to ask David about JDBC 3.0 support. How do you plan to 
>support JDBC 3.0 features in DbUtils?

What features specifically do you need support for?  

I haven't confirmed this but I believe we can include a call to
Statement.getGeneratedKeys() and still have DbUtils run on 1.3 JVMs.  You
would have to compile the code on 1.4 but I think as long as you don't try
to invoke getGeneratedKeys() on a 1.3 JVM you'll be ok.

Note that the protected QueryRunner.prepareStatement() method is already
the hook for creating PreparedStatements that will return generated keys
(by passing Statement.RETURN_GENERATED_KEYS into

>What's about DbUtils Option Pack :-) that will include only them?

I want to keep the releases and builds as simple as possible.  That's why
we use Proxies for the JDBC interfaces (which are incompatible between
versions) instead of concrete implementations:


>Best regards,
>Mikhail Krivoshein

Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger. 

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

View raw message