Neoview JDBC Type 4 Driver Programmer's Reference (R2.2, R2.3, R2.4, R2.5)
8 Tracing and Logging Facilities
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
Server-side tracing (logging) is enabled by configuring the HP connectivity service. For more
information, see the Neoview DB Admin 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
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 4 Driver Logging). The Type 4 Driver Logging provides the
same level of logging and tracing as the standard JDBC tracing and logging facility with the
following additional information:
• More detail about the internals of the Type 4 driver and internal tracing information
• Type 4 driver performance-tuning information
• Finer control over the amount and type of logging information
• Error and warning messages
Type 4 Driver Logging is described in these topics:
• “Accessing the Type 4 Driver Logging Facility” (page 74)
• “Controlling Type 4 Driver Logging Output” (page 74)
• “Message Format” (page 74)
• “Examples of Logging Output” (page 75)
Standard JDBC Tracing and Logging Facility 73