db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-1546) Derby JDBC 4.0 driver returns 3 for JDBC driver major version
Date Wed, 26 Jul 2006 15:06:15 GMT
     [ http://issues.apache.org/jira/browse/DERBY-1546?page=all ]

Knut Anders Hatlen updated DERBY-1546:
--------------------------------------

    Attachment: derby-1546-v1.diff
                derby-1546-v1.stat

derby-1546-v1.diff makes getJDBCMajorVersion() return 4 when using the
JDBC 4.0 driver and 3 otherwise (the method was not present in JDBC
2.0, so there is no need to return 2 for the 2.0 driver).

Description of the changes:

  * EmbedDatabaseMetaData40 and NetDatabaseMetaData40 override
    getJDBCMajorVersion() and getJDBCMinorVersion().

  * jdbcapi/dbMetaDataJdbc30.java was modified to print "AS EXPECTED"
    instead of the returned value from the JDBC version methods (of
    course, it prints something else if the version is not as
    expected). This was done in order to avoid the need for separate
    jdk16 canons.

  * TestUtil.getJDBCMajorVersion() was updated to recognize JDBC major
    version > 3.

  * Fixed a bug in build.xml in functionTests/util. TestUtil.java is
    incorrectly compiled with source and target level 1.4. It works
    correctly after an 'ant clobber' because some other 1.3 class
    depends on it and causes it to be compiled as part of another ant
    target, but if TestUtil.java is the only file that needs
    recompilation, jdk 1.4 is used.

Derbyall runs cleanly (with the exception of the DERBY-1578 failures)
on Sun JVM 1.5 and 1.6. Reviews would be greatly appreciated! Thanks.

> Derby JDBC 4.0 driver returns 3 for JDBC driver major version
> -------------------------------------------------------------
>
>                 Key: DERBY-1546
>                 URL: http://issues.apache.org/jira/browse/DERBY-1546
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.2.0.0
>            Reporter: Kathey Marsden
>         Assigned To: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: derby-1546-v1.diff, derby-1546-v1.stat
>
>
> For 10.2 the DatabaseMetaData.getJDBCMajorVersion() is returning "3" for 
> the Derby JDBC 4.0 driver.  It should return 4.  This is easily 
> reproduced by running a simple test to obtain a connection and 
> output the value,
> Database product: Apache Derby
> Database version: 10.2.0.4 alpha
> Driver name:      Apache Derby Embedded JDBC Driver
> Driver version:   10.2.0.4 alpha
> JDBC driver major version: 3
> JDBC driver minor version: 0
> Test code:
>         
> org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40 ds =
>             new 
> org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40();
>         
> ds.setDatabaseName("C:\\drivers\\derby\\databases\\JDBC40DB");
>         ds.setUser("dbuser1");
>         ds.setPassword("dbpwd1");
>         PooledConnection pooledConn = 
> ds.getPooledConnection();
>         Connection conn = pooledConn.getConnection();
>         System.out.println("Database product: " + 
> conn.getMetaData().getDatabaseProductName());
>         System.out.println("Database version: " + 
> conn.getMetaData().getDatabaseProductVersion());
>         System.out.println("Driver name:      " + 
> conn.getMetaData().getDriverName());
>         System.out.println("Driver version:   " + 
> conn.getMetaData().getDriverVersion());
>         System.out.println("JDBC driver major version: " + 
> conn.getMetaData().getJDBCMajorVersion());
>         System.out.println("JDBC driver minor version: " + 
> conn.getMetaData().getJDBCMinorVersion());
> Relevant Derby Embedded code in EmbedDatabaseMetaData is:
>  * JDBC 3.0
>     *
>     * Retrieves the major JDBC version number for this driver.
>     *
>     * @return JDBC version major number
> 	*/
> 	public int getJDBCMajorVersion()
> 	{
> 		return 3;
> 	}
> and client code in org.apache.derby.client.am.DatabaseMetaData:
> public int getJDBCMajorVersion() throws SQLException {
>         checkForClosedConnection();
>         return 3;
>     }
> I am not sure if this should be JVM dependent or if it should always return 4  regardless
of the JVM version.

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

        

Mime
View raw message