IBM DB2 Manual page 376

Table of Contents

Advertisement

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360
Application Programming Guide and Reference for Java
DB2TraceManager methods
getTraceManager
Format:
static public DB2TraceManager getTraceManager()
throws java.sql.SQLException
Gets an instance of the global log writer.
setLogWriter
Formats:
public abstract void setLogWriter(String traceDirectory,
String baseTraceFileName, int traceLevel)
throws java.sql.SQLException
public abstract void setLogWriter(String traceFile,
boolean fileAppend, int traceLevel)
throws java.sql.SQLException
public abstract void setLogWriter(java.io.PrintWriter logWriter,
int traceLevel)
throws java.sql.SQLException
Enables a global trace. After setLogWriter is called, all calls for DataSource or
Connection traces are discarded until DB2TraceManager.unsetLogWriter is
called.
When setLogWriter is called, all future Connection or DataSource traces are
redirected to a trace file or PrintWriter, depending on the form of
setLogWriter that you use. If the global trace is suspended when setLogWriter
is called, the specified settings take effect when the trace is resumed.
Parameter descriptions:
traceDirectory
Specifies a directory into which global trace information is written. This
setting overrides the settings of the traceDirectory and logWriter properties
for a DataSource or DriverManager connection.
When the form of setLogWriter with the traceDirectory parameter is used,
the JDBC driver sets the traceFileAppend property to false when
setLogWriter is called, which means that the existing log files are
overwritten. Each JDBC driver connection is traced to a different file in the
specified directory. The naming convention for the files in that directory
depends on whether a non-null value is specified for baseTraceFileName:
v If a null value is specified for baseTraceFileName, a connection is traced
to a file named traceFile_global_n.
n is the nth JDBC driver connection.
v If a non-null value is specified for baseTraceFileName, a connection is
traced to a file named baseTraceFileName_global_n.
baseTraceFileName is the value of the baseTraceFileName parameter.
n is the nth JDBC driver connection.
baseTraceFileName
Specifies the stem for the names of the files into which global trace
information is written. The combination of baseTraceFileName and
traceDirectory determines the full path name for the global trace log files.
traceFileName
Specifies the file into which global trace information is written. This setting
overrides the settings of the traceFile and logWriter properties for a
DataSource or DriverManager connection.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents