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 #501 background imageLoading...
Page #501 background image
Formatting information about an SQLJ customized serialized
profile
The db2sqljprint utility formats information about each SQLJ clause in a
serialized profile that is customized for the IBM Data Server Driver for JDBC and
SQLJ.
Run the db2sqljprint utility on the customized serialized profile for the
connection in which the error occurs.
Related reference
“DB2Connection interface” on page 326
“db2sqljprint - SQLJ profile printer” on page 412
Example of using configuration properties to start a JDBC trace
You can control tracing of JDBC applications without modifying those applications.
Suppose that you want to collect trace data for a program named Test.java, which
uses IBM Data Server Driver for JDBC and SQLJ type 4 connectivity. Test.java does
no tracing, and you do not want to modify the program, so you enable tracing
using configuration properties. You want your trace output to have the following
characteristics:
v Trace information for each connection on the same DataSource is written to a
separate trace file. Output goes into a directory named /Trace.
v Each trace file name begins with jccTrace1.
v If trace files with the same names already exist, the trace data is appended to
them.
Although Test1.java does not contain any code to do tracing, you want to set the
configuration properties so that if the application is modified in the future to do
tracing, the settings within the program will take precedence over the settings in
the configuration properties. To do that, use the set of configuration properties that
begin with db2.jcc, not db2.jcc.override.
The configuration property settings look like this:
v db2.jcc.traceDirectory=/Trace
v db2.jcc.traceFile=jccTrace1
v db2.jcc.traceFileAppend=true
You want the trace settings to apply only to your stand-alone program Test1.java,
so you create a file with these settings, and then refer to the file when you invoke
the Java program by specifying the -Ddb2.jcc.propertiesFile option. Suppose that
the file that contains the settings is /Test/jcc.properties. To enable tracing when
you run Test1.java, you issue a command like this:
java -Ddb2.jcc.propertiesFile=/Test/jcc.properties Test1
Suppose that Test1.java creates two connections for one DataSource. The program
does not define a logWriter object, so the driver creates a global logWriter object
for the trace output. When the program completes, the following files contain the
trace data:
v /Trace/jccTrace1_global_0
v /Trace/jccTrace1_global_1
Chapter 15. Problem diagnosis with the IBM Data Server Driver for JDBC and SQLJ 485

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