How to enable JDBC tracing starting with JDBC version 3.0.x

Technote (troubleshooting)


Problem(Abstract)

How to enable JDBC tracing for debugging JDBC related issues from version 3.00.JC1 onwards.

Resolving the problem

INTRODUCTION


From version 3.00.JC1 of IBM® Informix® JDBC Driver onwards, debug drivers are no longer shipped.
Informix JDBC Driver now supports SQLIDEBUG. You no longer need to set values for TRACE, TRACEFILE or PROTOCOLTRACE, PROTOCOLTRACEFILE. You only need to set SQLIDEBUG.

STEPS

Using a simple java program called simple.java as an example, the following steps show how to create a trace with the Informix JDBC Driver.

Example:


1. Set the CLASSPATH to the Informix JDBC Driver package.

c:\Infx\Java>set
CLASSPATH=C:\infx\JDBC3.00JC3\lib\ifxjdbc.jar;C:\infx\JDBC3.00JC3\lib\ifxjdbcx.jar;.

2. Compile simple.java

c:\Infx\Java>javac simple.java

3. Ensure that SQLIDEBUG is set correctly

c:\Infx\Java>grep SQLIDEBUG simple.java  
conn=DriverManager.getConnection("jdbc:informix-sqli://irk:1526/sysmaster:INFORMIXSERVER=irk940;USER=informix;
PASSWORD=ximrofni;SQLIDEBUG=C:\\infx\\java\\trace");

Note: SQLIDEBUG is set in the connection string. It points to where the trace file will be found with a certain format i.e. trace.xxxxxxx

4. Remove or move all other trace files

c:\Infx\Java>del trace*

5. Run java.simple

c:\Infx\Java>java simple
systables
syscolumns
...
...
oledbordinals


6. Then locate the trace file

c:\Infx\Java>dir trace*
Volume in drive C has no label.
Volume Serial Number is B823-46D8

Directory of c:\Infx\Java

04/04/2006 14:12 20,560 trace1144156355642.0
1 File(s) 20,560 bytes
0 Dir(s) 4,067,995,648 bytes free


c:\Infx\Java>

7. You will be able to see that a trace file has been created however
you will not be able to read the file.

8. Send the trace file to your local technical support office for analysis.

Note: The code simple.java is found in the attachments

simple.java

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Informix Tools
Informix JDBC

Software version:

3.0

Operating system(s):

AIX, DYNIX/ptx, Digital Unix (OSF1)(TRU64), HP-UX, IRIX, Linux, Reliant UNIX, Sinix, Solaris, Windows

Reference #:

1237681

Modified date:

2014-01-06

Translate my page

Machine Translation

Content navigation