JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)

The following table describes the set of properties that are required for a trace data source object:
DescriptionTypeProperty Name
The data source name.StringdataSourceName
Description of this data source.Stringdescription
The name of the DataSource object to be
traced.
StringtraceDataSource
The traceDataSource object is used to obtain the JDBC connection to the database. Java
applications should turn on tracing using the setLogWriter method of the DataSource interface.
Tracing Using the java Command
Enable tracing by specifying the tracing system property by using the following arguments when
starting your Java program:
java -Djdbcmx.traceFile=logFile -Djdbcmx.traceFlag=n
The logFile is the file name that is to contain the tracing information. The n value for the
traceFlag can be the following values:
DescriptionValue for
n
No tracing.0
Traces connection and statement pooling calls only.1
Traces the LOB-code path only.2
Traces the entry point of all JDBC methods.3
NOTE: Only one traceFlag value can be in effect at a time.
Tracing Using the system.setProperty Method
Enable tracing by using the System.setProperty(key, value) to set the same value as
described above. For example:
System.setProperty("traceFile", "myLogFile.log");
System.setProperty("traceFlag", "2");
Set the system property before the program makes any JDBC API calls.
Tracing by Loading the Trace Driver Within the Program
Enable tracing by loading the JDBC trace driver within the program by using the
Class.forName("com.tandem.jdbc.TDriver") method. This method also requires that
you call the DriverManager.setLogWriter method.
Tracing Using a Wrapper Data Source
Enable tracing by creating a wrapper data source around the data source to be traced. The
wrapper data source contains the TraceDataSource property that you can set to the data source
to be traced. For information about demonstration programs that show using this method, see“JDBC
Trace Facility Demonstration Program (page 79).
Tracing Using the java Command 75