NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.1+)

| Contents | Index | Glossary | Prev | Next
JDBC Trace Facility
The JDBC trace facility is designed to trace the entry point of all the JDBC methods called from
the Java applications. To make this facility generic, it is implemented as wrapper JDBC driver;
it can therefore be used with the JDBC Driver for SQL/MP (JDBC/MP), the JDBC Driver for
NonStop SQL/MX (JDBC/MX), or the Compaq NonStop JDBC Server (a Type 3 JDBC
driver).
The JDBC trace facility can be enabled in either of the following two ways in which a JDBC
connection to a database can be obtained:
Using the DriverManager class
Using the DataSource implementaion
Tracing Using the DriverManager
Class
Java applications can use the DriverManager class to obtain the JDBC connection and
enable the JDBC trace facility by loading the JDBC trace driver.
com.tandem.jdbc.Tdriver is the trace driver class that implements the Driver interface.
The application can load the JDBC trace driver in one of the following ways:
Specify the JDBC trace driver class in the -Djdbc.drivers option in the command
line.
Use the Class.ForName method within the application.
Add the JDBC trace class to the jdbc.drivers property within the application.
The JDBC URL passed in the getConnection method of the driver class determines which
JDBC driver is used to obtain the connection. The following table shows the URL and the
corresponding JDBC driver used to obtain the JDBC connection:
URL JDBC Driver
jdbc:sqlmp:
JDBC/MP driver
jdbc:sqlmptx:
JDBC/MP driver
jdbc:sqlmx:
JDBC/MX driver