[ 
https://issues.apache.org/jira/browse/DBUTILS-87?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200795#comment-13200795
 ] 

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!

[1] 
http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#getGeneratedKeys()
                
> Return generated key on insert
> ------------------------------
>
>                 Key: DBUTILS-87
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-87
>             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: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to