Oracle8i JDBC Developer's Guide and Reference Release 3 (8.1.7) Part Number A83724-01 |
|
This section describes strategies for debugging a JDBC program:
For information about processing SQL exceptions, including printing stack traces to aid in debugging, see "Processing SQL Exceptions".
You can enable client and server Net8 trace to trap the packets sent over Net8. You can use client-side tracing only for the JDBC OCI driver; it is not supported for the JDBC Thin driver. You can find more information on tracing and reading trace files in the Net8 Administrator's Guide.
The trace facility produces a detailed sequence of statements that describe network events as they execute. "Tracing" an operation lets you obtain more information on the internal operations of the event. This information is output to a readable file that identifies the events that led to the error. Several Net8 parameters in the SQLNET.ORA
file control the gathering of trace information. After setting the parameters in SQLNET.ORA
, you must make a new connection for tracing to be performed.
The higher the trace level, the more detail is captured in the trace file. Because the trace file can be hard to understand, start with a trace level of 4 when enabling tracing. The first part of the trace file contains connection handshake information, so look beyond this for the SQL statements and error messages related to your JDBC program.
Set the following parameters in the SQLNET.ORA
file on the client system.
Purpose: |
Turns tracing on/off to a certain specified level. |
Default Value: |
0 or OFF |
Available Values: |
|
Example: |
TRACE_LEVEL_CLIENT=10 |
Purpose: |
Specifies the name of the client trace file. |
Default Value: |
SQLNET.TRC |
Example: |
TRACE_FILE_CLIENT=cli_Connection1.trc |
Default Value: |
OFF |
Example: |
TRACE_UNIQUE_CLIENT = ON |
Set the following parameters in the SQLNET.ORA
file on the server system. Each connection will generate a separate file with a unique file name.
Purpose: |
Turns tracing on/off to a certain specified level. |
Default Value: |
0 or OFF |
Available Values: |
|
Example: |
TRACE_LEVEL_SERVER=10 |
Purpose: |
Specifies the destination directory of the trace file. |
Default Value: |
$ORACLE_HOME/network/trace |
Example: |
TRACE_DIRECTORY_SERVER=/oracle/traces |
Purpose: |
Specifies the name of the server trace file. |
Default Value: |
SERVER.TRC |
Example: |
TRACE_FILE_SERVER= svr_Connection1.trc |
You can use tools such as JDBCSpy and JDBCTest from Intersolv to troubleshoot at the JDBC API level. These tools are similar to ODBCSpy and ODBCTest.
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|