traceLevel=value attribute

Function

If tracing is enabled, 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.

Tracing levels

The following table shows the available tracing levels and their values.

Table 1. Available tracing levels and 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 three ClientDataSource implementations. You can use the org.apache.derby.jdbc.ClientDataSource class on Java SE 5 and above (except Java SE 8 Compact Profiles), in applications that call JDBC 3 or JDBC 4.0 methods. You can use the org.apache.derby.jdbc.ClientDataSource40 class on Java SE 6 and above (except Java SE 8 Compact Profiles), in applications that call JDBC 4.1 or JDBC 4.2 methods. You must use the org.apache.derby.jdbc.BasicClientDataSource40 class on Java SE 8 Compact Profile 2 or 3.

To specify more than one trace level, use one of the following techniques:

Combining with other attributes

If you specify this attribute, you must also specify either the traceFile=path attribute or the traceDirectory=path attribute.

Example

-- enable tracing on a new database
jdbc:derby://localhost:1527/mydb;create=true;traceFile=trace.out;traceLevel=65