JDBC Type 4 Driver 1.1 Programmer's Reference

Chapter 8. Tracing and Logging Facilities
Prev
Next
Chapter 8. Tracing and Logging Facilities
Standard JDBC Tracing and Logging Facility
The Type 4 Driver Logging Facility
Accessing the Type 4 Driver Logging Facility
Controlling Type 4 Driver Logging Output
Message Format
Examples of Logging Output
The Type 4 driver provides two tracing and logging facilities:
Standard JDBC tracing and logging functionality as defined by the JDBC standard
Type 4 driver logging facility
MXCS (server-side) tracing (logging) is enabled by configuring MXCS. For information about MXCS tracing, see the
NSM/Web online help.
Standard JDBC Tracing and Logging Facility
The JDBC standard provides a logging and tracing facility, which allows tracing JDBC method calls by setting the log writer.
To set the log writer, either call the setLogWriter() method on the DriverManager class or call the
setLogWriter() method on the DataSource class (or ConnectionPoolDataSource class).
A DriverManager log writer is a character output stream to which all logging and tracing messages for all
connections made through the DriverManager are printed. This stream includes messages printed by the methods of
this connection, messages printed by methods of other objects manufactured by the connection, and so on. The
DriverManager log writer is initially null, that is, the default is for logging to be disabled.
For information about using the setLogWriter method, see the DriverManager class API
(http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DriverManager.html).
A DataSource log writer is a character output stream to which all logging and tracing messages for this data source
are printed. This stream includes messages printed by the methods of this object, messages printed by methods of other
objects manufactured by this object, and so on. Messages printed to a data-source-specific log writer are not printed to
the log writer associated with the java.sql.DriverManager class. When a DataSource object is created, the
log writer is initially null; that is, the default is for logging to be disabled.
For information about using the setLogWriter() method, see the DataSource interface API
(http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html).
The Type 4 Driver Logging Facility
Accessing the Type 4 Driver Logging Facility
Controlling Type 4 Driver Logging Output
Message Format
Examples of Logging Output
The Type 4 driver Logging facility allows you to retrieve internal tracing information, which you can use in debugging the
driver. It also allows you to capture error and warning messages.
In addition to the standard JDBC tracing and logging facility, the Type 4 driver provides an independent logging facility (Type