User guide
8.23 Trace
Trace provides tracing of method calls and other debug information within the Oracle JDBC
for Rdb drivers and servers. See Trace Values
for valid trace level values.
The trace level value may be a signed decimal or a Java-style hexadecimal literal.
By default, trace output is written to the normal JDBC DriverManager PrintWriter. You can
override the default by using one of the following settings:
•
•
8.23.1
•
• tracelevel switch
•
•
•
8.23.1.1
rdb.Debug.setLogStream(PrintStream ps)
rdb.Debug.setLogWriter(PrintWriter pw)
Example
The following example shows how to override the default:
rdb.Debug.setLogStream(new PrintStream(
new FileOutputStream("mylog.log")));
If trace is enabled and the DriverManager PrintWriter is not currently defined a PrintWriter
for System.out is defined for you.
Setting tracelevel
Trace of JDBC operations may be enabled using one of the following methods:
tracelevel property
tracelevel option
Doracle.rdb.jdbc.tracelevel system option
Set tracelevel
Details of these methods can be found in the following sections.
Tracelevel Property
Tracing can be enabled by setting the tracelevel property of the Properties passed to the
DriverManager.getConnection method to the appropriate value:
Example
Properties info = new Properties();
info.put("user", user);
info.put("password", pw);
info.put("tracelevel", -1);
conn = DriverManager.getConnection (connStr, info);
136