-
Bug
-
Resolution: Fixed
-
P5
-
1.2.0
-
beta
-
generic
-
generic
Name: stC104175 Date: 07/19/2000
The tracing methods in sun.jdbc.odbc.JdbcOdbcObject use
java.sql.DriverManager.getLogStream(), which is deprecated. A
non-deprecated API (DriverManager.getLogWriter() and
DriverManager.println(String message)) is available. In fact, I believe
drivers are supposed to call DriverManager.println to output messages,
instead of explicitly printing themselves. Why is the deprecated API
being used, and printing done explicitly?
Here is the relevant code, from sun.jdbc.odbc.JdbcOdbcObject.
protected static boolean isTracing ()
{
return (DriverManager.getLogStream () != null);
}
(Note that if the user calls DriverManger.setLogWriter, the logStream
is set to null. So apparently the isTracing method only applies to the
deprecated logStream API.)
protected static void trace (
String outLine)
{
java.io.PrintStream outStream = DriverManager.getLogStream ();
// Sanity check to ensure we have a print stream
if (outStream != null) {
outStream.println (outLine);
}
}
protected static void trace (
String outLine,
boolean advance)
{
// If advancing line, use default implementation
if (advance) {
trace (outLine);
}
java.io.PrintStream outStream = DriverManager.getLogStream ();
// Sanity check to ensure we have a print stream
if (outStream != null) {
outStream.print (outLine);
}
}
(Review ID: 107379)
======================================================================