How To Collect DB2 JCC Trace

Please collect a JCC Trace. Here are the instructions how to do this:

1) If you are using the datasource, then use the datasource.setTraceFile(TRACEFILE) to enable tracing.

2) If you are using DriverManger, the easiest way will be to set the logWriter on DriverManager before obtaining a connection.
    For example:
         DriverManager.setLogWriter(new PrintWriter(new FileOutputStream("trace.txt")));

3) You can also set the traceFile property on the URL. If traceFile property is specified, by default traceLevel is TRACE_ALL
    String databaseURL = "jdbc:db2://hal:50000/sample:traceFile=c:/temp/foobar.txt;" ;

Please see the following URLs for additional assistance :
http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/ad/cjvjcdig.htm
http://www.ibm.com/software/data/pubs/papers/sqlj (Section 3.4 – Trace)

Leave a Reply