JDBC Driver for SQL/MP 3.0
Java Docs Home Page | 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.
The JDBC trace facility can be enabled in any of these ways in which a JDBC connection to a database can be
obtained:
Tracing using the DriverManager Class
Tracing using the DataSource Implementation
Tracing by loading the trace driver within the program
Tracing using a wrapper data source
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 these 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. This 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
Java applications should turn on tracing using the DriverManager.setLogWriter method, for example by using this
JDBC API call in your application:
DriverManager.setLogWriter(new PrintWriter(new FileWriter("FileName")));
Tracing Using the DataSource Implementation
This is preferred way to establish a JDBC connection and to enable the JDBC trace facility. In this way, a logical
name is mapped to a trace data source object by means of a naming service that uses the Java Naming and Directory
Interface (JNDI).