Currently I am working on fixing an issue with the Java-DB2 connection leak. For which I require the CLI Trace logs. In my db2cli.ini I have added the below parameters, but still I am not getting the the trace logs.


Earlier we were using DB2 9.7 in which I was able to get the logs for the above changes. And now we are using DB2 10.5.3. I am trying it myself. Meanwhile it would be helpful on getting an Expert advice.

1 Answer 1


Looks like you are confusing the JDBC trace and the CLI trace. To enable the JDBC trace in the JCC driver, which is the only one available in DB2 10.5, you need to set the JDBC connection properties as described in the manual, for example, via the JDBC URL:

String url = "jdbc:db2://my.host.com:50000/mydb" +
             ":traceFile=/tmp/jcc.trc;" +
             "traceLevel=" + com.ibm.db2.jcc.DB2BaseDataSource.TRACE_DRDA_FLOWS + ";";

Various trace levels are described here.

Only the Type 2 JDBC driver will read db2cli.ini, so setting CLI properties has no effect if you are using Type 4 connectivity. Type 2 connectivity is deprecated an is not recommended for use.

  • @musstaccio Thanks for the efforts on explanation. I am trying to understand the configuration. But the options that I have added should have some effect right? As I see in the link those parameters seems to be valid. Why won't it have any effect? Sep 17, 2014 at 14:36
  • As I said, the JCC driver never reads db2cli.ini. The parameters there were for the Type 2 JDBC driver, which was deprecated long ago. You shouldn't be referring to the DB2 9.5 documentation if you use DB2 10.5.
    – mustaccio
    Sep 17, 2014 at 14:41
  • @mustaccio The JCC driver has both a Type 2 driver and a Type 4 driver, depending on the JDBC URL you use. (jdbc:db2:mydb = Type 2 and depends on the native DB2 Client libraries; jdbc:db2://my.host.com:50000/mydb = Type 4 and is pure Java) Sep 17, 2014 at 15:30
  • @IanBjorhovde -- clarified the terminology, thanks.
    – mustaccio
    Sep 17, 2014 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.