JDBC tracing for the Liberty profile is enabled either
through a driver-specific custom trace setting, or using the application
server supplemental JDBC tracing option.
About this task
There are two ways of using driver-specific custom trace
facilities:
- Using the Java™ built-in
logging mechanism, java.util.logging, if the driver
supports it.
- Configuring a custom trace setting as a vendor property.
If your JDBC driver does not provide its own custom tracing or
logging facilities, or the facilities it provides are minimal, you
can use supplemental JDBC tracing from the application server.
If
you enable tracing by using either a custom vendor property or supplemental
JDBC tracing, you must add the logwriter name to the trace specification
in the
bootstrap.properties file. You can use
any of the following logwriters:
- DB2®
- com.ibm.ws.db2.logwriter
- Derby
- com.ibm.ws.derby.logwriter
- Informix® JCC (uses
the same driver as DB2)
- com.ibm.ws.db2.logwriter
- Informix JDBC
- com.ibm.ws.informix.logwriter
- Microsoft SQL Server
JDBC Driver
- com.ibm.ws.sqlserver.logwriter
- DataDirect Connect for JDBC for Microsoft SQL
Server
- com.ibm.ws.sqlserver.logwriter
- Sybase
- com.ibm.ws.sybase.logwriter
- Other databases (for example solidDB® and
MySQL)
- com.ibm.ws.database.logwriter
Because changes to trace enablement involve
altering the bootstrap.properties file, you must
restart the server for the changes to take effect.
The following
examples illustrate the use of the various JDBC trace methods.