Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2488

When loaded by jvm1.6 - EmbeddedConnectionPoolDataSource is not returning a JDBC 4 compliant PooledConnection object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.2.2.0
    • 10.3.1.4
    • JDBC
    • None
    • Run test using JVM 1.6
    • Urgent

    Description

      Updated the problem description to reflect the actual issue [Stan 4/5/07]: EmbeddedConnectionPoolDataSource is not returning a JDBC 4 compliant PooledConnection object

      When loaded using JVM 1.6 the JDBC 3.0 data source (org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource) is reporting a JDBC spec compliance level of 4. The DatabaseMetaData.getJDBCMajorVersion method should return the
      correct spec compliance level (3) for the JDBC 3.0 data source. The application server that relies on the reported spec compliance level to determine if a statement event listener should be registered will encounter a failure when attemptting to register an event listener with the JDBC 3.0 driver.

      Note that the JDBC 4.0 metadata call ..getMetaData().supportsStoredFunctionsUsingCallSyntax() is executed by the JDBC 3.0 driver. This doesn't bother me but seems curious that this is supported by a JDBC 3.0 driver.

      Attached is a test case based on the test code from DERBY-8862 (JDBC 4 driver reports incorrect spec complieance level).

      Running the test:
      set JAVA_HOME to a 1.6 JVM
      Compile program
      run command: ${JAVA_HOME}/java showJDBCdsMetaDataLis <path-to-database> 3.0

      Using JAVA 6.0

      > "%JAVA_HOME%\bin\java" showJDBCdsMetaDataLis "c:\tstdb102" 3.0
      . . JDBC 3 or less: Using jdbc.EmbeddedConnectionPoolDataSource
      Database product: Apache Derby
      Database version: 10.2.2.0 - (485682)
      Driver name: Apache Derby Embedded JDBC Driver
      Driver version: 10.2.2.0 - (485682)
      JDBC driver major version: 4
      JDBC driver minor version: 0
      JDBC 4.0 metaData - SFusingCall: true
      >> exception thrown:
      A non SQL error occured.
      java.lang.AbstractMethodError: org.apache.derby.jdbc.EmbedPooledConnection.addStatementEventListener(Ljavax/sql/Statemen
      tEventListener;)V
      at showJDBCdsMetaDataLis.main(showJDBCdsMetaDataLis.java:103)

      Attachments

        1. d2488_notTested_v1.patch
          4 kB
          A B
        2. d2488_v2.patch
          11 kB
          A B
        3. d2488_v3.patch
          30 kB
          A B
        4. d2488_v3.stat
          1 kB
          A B
        5. d2488_v4.patch
          31 kB
          A B
        6. showJDBCdsMetaDataLis.class
          4 kB
          Sun Seng David Tan
        7. showJDBCdsMetaDataLis.class
          4 kB
          Sun Seng David Tan
        8. showJDBCdsMetaDataLis.java
          5 kB
          Sun Seng David Tan
        9. showJDBCdsMetaDataLis.java
          5 kB
          Sun Seng David Tan

        Activity

          People

            army A B
            stan Sun Seng David Tan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: