JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)
jdbcTrace:[timestamp] [thread-id]:[object-id] :className.method(param...)
returns [return-object] [return-object-id]
where
timestamp
is the day and time representation in the form: mm/dd/yy hr:min:sec
where mm is month; dd , day; yy , year; hr , hour; min , minute; sec , seconds.
thread-id
is the String representation of the current thread.
object-id
is the hashcode of the JDBC object.
classname
is the JDBC implementation class name.
return-object
is the object returned by the traced method. The return-object can be one of
the following interface types: CallableStatement, Connection,
PooledConnection, ResultSet, Statement, DatabaseMetaData,
ParameterMetaData, or ResultSetMetaData.
return-object-id
is the hashcode of the object returned by the traced method.
Trace output is sent to the PrintWriter specified in the setLogWriter method.
Example 1 Example 1
jdbcTrace:[10/12/05 10:04:39]
[Thread[main,5,main]]:[5256233]:com.tandem.sqlmx.SQLMXPreparedStatement.executeQuery()
Example 2 Example 2
Some traced methods will have two trace statements, one for the method entry point and the other
for return object mapping. Some code paths might log additional tracing statements between
method entry and the return. For example, between SQLMXConnection.prepareStatement () trace
entries, you might see:
jdbcTrace:[10/12/05 10:04:39]
[Thread[main,5,main]]:[10776760]:SQLMXConnection.prepareStatement("select c1, c2 from tconpool
where c1 = ?")
<additional trace entries>
<jdbcTrace:[10/12/05 10:04:39]
[Thread[main,5,main]]:[10776760]:SQLMXConnection.prepareStatement("select c1, c2 from tconpool
where c1 = ?") returns PreparedStatement [23276589]
Logging SQL Statement IDs and Corresponding JDBC SQL Statements
The JDBC/MX driver can write a supplemental log file that shows the SQL statement ID (STMID)
of executed SQL statements mapped with the corresponding JDBC SQL statements.
The idMapFile contains a list of all the SQL statements issued by the application, and correlates
them to the internal driver STMTID (a hashcode). The trace-file output (see Trace-File Output) lists
the STMID (the object-id in the trace output), which can be used to reference the SQL statements
in the idMapFile trace file.
The statement-ID is logged in the idMapFile to avoid replacing the object-id in the trace-file
output with the verbose and potentially large SQL statement for every entry.
Logging SQL Statement IDs and Corresponding JDBC SQL Statements 77










