If tracing is enabled, the traceLevel=value attribute specifies the level of tracing to be used by the Derby Network Client.
The value is numeric. If you do not specify a trace level, the default is TRACE_ALL.
For more information about tracing, see "Network client tracing" in the Derby Server and Administration Guide. See traceFile=path, traceFileAppend=true, and traceDirectory=path for other attributes related to tracing.
The following table shows the available tracing levels and their values.
Trace Level | Hex Value | Decimal Value |
---|---|---|
org.apache.derby.jdbc.ClientDataSource.TRACE_NONE | 0x0 | 0 |
org.apache.derby.jdbc.ClientDataSource.TRACE_CONNECTION_CALLS | 0x1 | 1 |
org.apache.derby.jdbc.ClientDataSource.TRACE_STATEMENT_CALLS | 0x2 | 2 |
org.apache.derby.jdbc.ClientDataSource.TRACE_RESULT_SET_CALLS | 0x4 | 4 |
org.apache.derby.jdbc.ClientDataSource.TRACE_DRIVER_CONFIGURATION | 0x10 | 16 |
org.apache.derby.jdbc.ClientDataSource.TRACE_CONNECTS | 0x20 | 32 |
org.apache.derby.jdbc.ClientDataSource.TRACE_PROTOCOL_FLOWS | 0x40 | 64 |
org.apache.derby.jdbc.ClientDataSource.TRACE_RESULT_SET_META_DATA | 0x80 | 128 |
org.apache.derby.jdbc.ClientDataSource.TRACE_PARAMETER_META_DATA | 0x100 | 256 |
org.apache.derby.jdbc.ClientDataSource.TRACE_DIAGNOSTICS | 0x200 | 512 |
org.apache.derby.jdbc.ClientDataSource.TRACE_XA_CALLS | 0x800 | 2048 |
org.apache.derby.jdbc.ClientDataSource.TRACE_ALL | 0xFFFFFFFF | -1 |
Derby provides two ClientDataSource implementations. You can use the org.apache.derby.jdbc.ClientDataSource class on all supported Java SE versions except Java SE 8 Compact Profile 2. On Java SE 8 Compact Profile 2, you must use the org.apache.derby.jdbc.BasicClientDataSource40 class. See JDBC support for Java SE 8 Compact Profiles for more information.
To specify more than one trace level, use one of the following techniques:
TRACE_PROTOCOL_FLOWS | TRACE_CONNECTION_CALLS
~TRACE_PROTOCOL_FLOWS
If you specify this attribute, you must also specify either the traceFile=path attribute or the traceDirectory=path attribute.
-- enable tracing on a new database jdbc:derby://localhost:1527/mydb;create=true;traceFile=trace.out; traceLevel=65