DB2 Version 9.7 for Linux, UNIX, and Windows

DB2ExceptionFormatter class

The com.ibm.db2.jcc.DB2ExceptionFormatter class contains methods for printing diagnostic information to a stream.

DB2ExceptionFormatter methods

The following methods are defined only for the IBM® Data Server Driver for JDBC and SQLJ.

printTrace
Formats:
static public void printTrace(java.sql.SQLException sqlException,
  java.io.PrintWriter printWriter, String header)

static public void printTrace(DB2Sqlca sqlca,
  java.io.PrintWriter printWriter, String header)

static public void printTrace(java.lang.Throwable throwable,
  java.io.PrintWriter printWriter, String header)

Prints diagnostic information after an exception is thrown.

Parameter descriptions:
sqlException|sqlca|throwable
The exception that was thrown during a previous JDBC or Java™ operation.
printWriter
The destination for the diagnostic information.
header
User-defined information that is printed at the beginning of the output.