-
Bug
-
Resolution: Fixed
-
P3
-
7, 8
FULL PRODUCT VERSION :
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
It is not possible to get the information printed by loadInitialDrivers().
The only way to get the logs is to set a the logWriter / logStream.
Since loadInitialDrivers() is only called in the static{} block, before setting the logWriter, the information is lost.
REGRESSION. Last worked in version 6u45
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
System.out:
JdbcOdbcDriver class loaded
registerDriver: driver[className=sun.jdbc.odbc.JdbcOdbcDriver,sun.jdbc.odbc.JdbcOdbcDriver@5e743399]
DriverManager.initialize: jdbc.drivers = null
JDBC DriverManager initialized
ACTUAL -
System.out:
(nothing)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package bug.reproduce;
import java.io.PrintWriter;
import java.sql.Driver;
import java.sql.DriverManager;
import java.util.Enumeration;
public class DriverManager_noInitialLog {
public static void main(String[] args) {
// Setup the LogWriter
DriverManager.setLogWriter(new PrintWriter(System.out));
// get the Drivers
Enumeration<Driver> drivers = DriverManager.getDrivers();
}
}
---------- END SOURCE ----------
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
It is not possible to get the information printed by loadInitialDrivers().
The only way to get the logs is to set a the logWriter / logStream.
Since loadInitialDrivers() is only called in the static{} block, before setting the logWriter, the information is lost.
REGRESSION. Last worked in version 6u45
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
System.out:
JdbcOdbcDriver class loaded
registerDriver: driver[className=sun.jdbc.odbc.JdbcOdbcDriver,sun.jdbc.odbc.JdbcOdbcDriver@5e743399]
DriverManager.initialize: jdbc.drivers = null
JDBC DriverManager initialized
ACTUAL -
System.out:
(nothing)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package bug.reproduce;
import java.io.PrintWriter;
import java.sql.Driver;
import java.sql.DriverManager;
import java.util.Enumeration;
public class DriverManager_noInitialLog {
public static void main(String[] args) {
// Setup the LogWriter
DriverManager.setLogWriter(new PrintWriter(System.out));
// get the Drivers
Enumeration<Driver> drivers = DriverManager.getDrivers();
}
}
---------- END SOURCE ----------