commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William R. Speirs (Commented) (JIRA)" <>
Subject [jira] [Commented] (DBUTILS-87) Return generated key on insert
Date Sun, 05 Feb 2012 16:05:53 GMT


William R. Speirs commented on DBUTILS-87:

Looking at this patch I noticed that there are two other possible calls which users might
want to create the prepared statement:

prepareStatement(String sql, int[] columnIndexes)
prepareStatement(String sql, String[] columnNames)

This would be in the case that the insert call auto-generates more than one column of keys
(a good example of doing that is escaping me now, but ...). With the call in the current patch
prepareStatement(String sql, int autoGeneratedKeys) JDBC will, "determine the columns which
best represent the auto-generated keys." [1]

I don't have much experience with this, but do we think this would bite people? It's always
hard to tell when it's JDBC driver implementation specific. Thoughts?

Otherwise, the patch is missing (as noted above) JavaDocs and the async implementation, but
looks sound. If you can update your patch with these additional things, I'll look to commit
it. Thanks!

> Return generated key on insert
> ------------------------------
>                 Key: DBUTILS-87
>                 URL:
>             Project: Commons DbUtils
>          Issue Type: New Feature
>            Reporter: Moandji Ezana
>            Assignee: William R. Speirs
>         Attachments: QueryRunner_insert.txt
> It would be useful to have an insert method on QueryRunner that returns the id of the
new record.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message