Debug your JDBC API program

You can set the SQLIDEBUG connection property to generate binary protocol trace. You set the connection property SQLIDEBUG to specify a file. For example:
SQLIDEBUG=C:\\tmp\\ifxjdbctrace

A new trace file is generated for every connection and is suffixed with a timestamp. If you are using the IfxDataSource interface, you can use the IfxDataSource.setIfxSQLIDEBUG (String fname) method. Debug versions of the JDBC jar files are not included in HCL OneDB™ JDBC Driver, Version 3.00.JC1 and later.

Important: The binary SQLI protocol trace feature (SQLIDEBUG) should only be used when directed by the HCL technical support representative.

Java Logging

You can enable tracing of the Informix JDBC driver using Java’s built in logging mechanism.
Note: Enabling tracing can have a noticeable impact on driver performance. Enable only logging to assist in diagnosing a problem with the driver.
Following example shows logging properties you can set:
Set the default logging level for Informix JDBC
com.informix.jdbc.level=FINEST

#Set the logging level for the console output
java.util.logging.ConsoleHandler.level=FINEST
java.util.logging.ConsoleHandler.formatter=com.informix.util.JdbcLogFormatter
com.informix.jdbc.handlers=java.util.logging.ConsoleHandler

#Set the properties for a file based logger
java.util.logging.FileHandler.level     = FINEST
java.util.logging.FileHandler.formatter = com.informix.util.JdbcLegacyLogFormatter
java.util.logging.FileHandler.append    = false
java.util.logging.FileHandler.pattern   = /tmp/jdbc/jdbc.log
When choosing the formatter for the log output you can pick between com.informix.util.JdbcLogFormatter and com.informix.util.JdbcLegacyLogFormatter. The legacy formatter matches the historical format the JDBC driver outputted messages in. The JdbcLogFormatter is a more modern format, which includes machine readable timestamps, so the logs can be read in by logging systems. If you need to manually add the properties, you can use a call as shown below in Java to load the properties for the Java Logging.
LogManager.getLogManager().readConfiguration(new FileInputStream(“logging.properties"));