EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #500 background imageLoading...
Page #500 background image
The default trace level is TRACE_ALL. See Properties for the IBM Data Server
Driver for JDBC and SQLJ for information on how to specify more than one
type of tracing.
2. Invoke the DriverManager.setLogWriter method to specify the trace destination
and turn the trace on.
After a connection is established, you can turn the trace off or back on, change the
trace destination, or change the trace level with the
DB2Connection.setJccLogWriter method. To turn the trace off, set the logWriter
value to null.
The logWriter property is an object of type java.io.PrintWriter. If your
application cannot handle java.io.PrintWriter objects, you can use the traceFile
property to specify the destination of the trace output. To use the traceFile
property, set the logWriter property to null, and set the traceFile property to the
name of the file to which the driver writes the trace data. This file and the
directory in which it resides must be writable. If the file already exists, the driver
overwrites it.
Procedure 5: If you are using the DriverManager interface, specify the traceFile and
traceLevel properties as part of the URL when you load the driver. For example:
String url = "jdbc:db2://sysmvs1.stl.ibm.com:5021/san_jose" +
":traceFile=/u/db2p/jcctrace;" +
"traceLevel=" + com.ibm.db2.jcc.DB2BaseDataSource.TRACE_DRDA_FLOWS + ";";
Procedure 6: Use DB2TraceManager methods. The DB2TraceManager class provides the
ability to suspend and resume tracing of any type of log writer.
Example of starting a trace using configuration properties: For a complete example of
using configuration parameters to collect trace data, see Example of using
configuration properties to start a JDBC trace.
Trace example program: For a complete example of a program for tracing under the
IBM Data Server Driver for JDBC and SQLJ, see Example of a trace program
under the IBM Data Server Driver for JDBC and SQLJ.
Collecting SQLJ trace data during customization or bind
To collect trace data to diagnose problems during the SQLJ customization or bind
process, specify the -tracelevel and -tracefile options when you run the
db2sqljcustomize or db2sqljbind bind utility.
Formatting information about an SQLJ serialized profile
The profp utility formats information about each SQLJ clause in a serialized
profile. The format of the profp utility is:
 profp serialized-profile-name 
Run the profp utility on the serialized profile for the connection in which the error
occurs. If an exception is thrown, a Java stack trace is generated. You can
determine which serialized profile was in use when the exception was thrown
from the stack trace.
484 Application Programming Guide and Reference for Java

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability