-
Type:
Bug
-
Resolution: Future Project
-
Priority:
P5
-
None
-
Affects Version/s: 6
-
Component/s: core-libs
-
x86
-
windows_xp
FULL PRODUCT VERSION :
C:\Programme\Java\jdk1.6.0\bin>java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows XP prof. SP-2
A DESCRIPTION OF THE PROBLEM :
In the javadoc of javax.sql.DataSource is written:
A driver that is accessed via a DataSource object does not register itself with the DriverManager.
The current implementation of Java 6.0 of sun.jdbc.odbc.ee.DataSource does not fulfil this directive.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Instantiate an sun.jdbc.odbc.ee.DataSource object, and invoke method getConnection() .
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A driver that is accessed via a DataSource object should not register itself with the DriverManager.
ACTUAL -
Invoking of 'new JdbcOdbcDriver()' automatically registers the driver with the DriverManager.
See source code below ...
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
See the part of the source code of class sun.jdbc.odbc.ee.DataSource:
public Connection getConnection() throws SQLException{
attrib = super.getAttributes();
JdbcOdbcDriver driver = new JdbcOdbcDriver();
driver.setTimeOut(super.getLoginTimeout());
driver.setWriter(super.getLogWriter());
return driver.connect(attrib.getUrl(),attrib.getProperties());
}
Invoking of 'new JdbcOdbcDriver()' automatically registers the driver with the DriverManager.
The source code should be something like this:
public Connection getConnection() throws SQLException {
// Load our ODBC API object allocate the environment handle,
// create the connection object and connect it.
return new JdbcOdbcConnection(getOdbcApi().initialize()).initialize(getConnectProperties());
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use: https://jdbc-odbc-enhanced.dev.java.net
C:\Programme\Java\jdk1.6.0\bin>java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows XP prof. SP-2
A DESCRIPTION OF THE PROBLEM :
In the javadoc of javax.sql.DataSource is written:
A driver that is accessed via a DataSource object does not register itself with the DriverManager.
The current implementation of Java 6.0 of sun.jdbc.odbc.ee.DataSource does not fulfil this directive.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Instantiate an sun.jdbc.odbc.ee.DataSource object, and invoke method getConnection() .
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A driver that is accessed via a DataSource object should not register itself with the DriverManager.
ACTUAL -
Invoking of 'new JdbcOdbcDriver()' automatically registers the driver with the DriverManager.
See source code below ...
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
See the part of the source code of class sun.jdbc.odbc.ee.DataSource:
public Connection getConnection() throws SQLException{
attrib = super.getAttributes();
JdbcOdbcDriver driver = new JdbcOdbcDriver();
driver.setTimeOut(super.getLoginTimeout());
driver.setWriter(super.getLogWriter());
return driver.connect(attrib.getUrl(),attrib.getProperties());
}
Invoking of 'new JdbcOdbcDriver()' automatically registers the driver with the DriverManager.
The source code should be something like this:
public Connection getConnection() throws SQLException {
// Load our ODBC API object allocate the environment handle,
// create the connection object and connect it.
return new JdbcOdbcConnection(getOdbcApi().initialize()).initialize(getConnectProperties());
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use: https://jdbc-odbc-enhanced.dev.java.net