[logback-dev] [JIRA] Resolved: (LBCORE-15) Problems getting autogenerated Keys in Oracle with Oracle JDBC 10.2.03

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Wed Oct 22 23:01:22 CEST 2008

     [ http://jira.qos.ch/browse/LBCORE-15?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ceki Gulcu resolved LBCORE-15.

    Fix Version/s: 0.9.10
       Resolution: Fixed

It's actually more of a JDBC driver issue then a RDBMS version
issue. I could reproduce the problem on Oracle 10g using ojdbc14.jar
(version This JDBC drivers support the getGeneratedKeys
method. The problem cannot be reproduced with an older driver,
classic12.jar, version, because it does not support

Anyway, the code has been modified to use the
connection. prepareStatement() method taking two arguments, the sql
statement follows by the auto-generated columnNames, as suggested John
Gibson. Surprisingly enough, this change is compatible with other
databases supporting getGeneratedKeys().

Fixed in revision 1859

> Problems getting autogenerated Keys in Oracle with Oracle JDBC 10.2.03
> ----------------------------------------------------------------------
>                 Key: LBCORE-15
>                 URL: http://jira.qos.ch/browse/LBCORE-15
>             Project: logback-core
>          Issue Type: Bug
>          Components: Appender
>    Affects Versions: unspecified
>         Environment: Operating System: Windows
> Platform: PC
>            Reporter: Klaus Unger
>            Assignee: Logback dev list
>            Priority: Blocker
>             Fix For: 0.9.10
> I've encountered troubles logging StackTrace/MDC entries with die DBAppender on our plattform! We are using Oracle on a Solaris Box with Oracle JDBC Driver!
> I've debugged the processing of LogMessages into DBAppenderBase.append()!
> There I found a call "con.prepareStatement(getInsertSQL())" which is followed by a call "subAppend(...)"
> As far as I understand Oracle Drivers return generatedKeys only, if you use the right prepareStatement() methods, which is in my understanding the following:
> PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
>                                    throws SQLException
> @see http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html#prepareStatement(java.lang.String,%20int)
> which is available since JDK 1.4

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the logback-dev mailing list