IBM DB2 Manual page 92

Table of Contents

Advertisement

getThrowable
printTrace
SQLException subclasses
If you are using JDBC 4.0 or later, you can obtain more specific information than
an SQLException provides by catching the following exception classes:
v SQLNonTransientException
v SQLTransientException
v SQLRecoverableException
v SQLClientInfoException
BatchUpdateException
A BatchUpdateException object contains the following items about an error that
occurs during execution of a batch of SQL statements:
v A String object that contains a description of the error, or null.
v A String object that contains the SQLSTATE for the failing SQL statement, or
v An integer value that contains the error code, or zero
v An integer array of update counts for SQL statements in the batch, or null
v A pointer to an SQLException object, or null
One BatchUpdateException is thrown for the entire batch. At least one
SQLException object is chained to the BatchUpdateException object. The
76
Application Programming Guide and Reference for Java
v The SQLSTATE
Returns a java.lang.Throwable object that caused the SQLException, or null, if
no such object exists.
Prints diagnostic information.
An SQLNonTransientException is thrown when an SQL operation that failed
previously cannot succeed when the operation is retried, unless some corrective
action is taken. The SQLNonTransientException class has these subclasses:
– SQLFeatureNotSupportedException
– SQLNonTransientConnectionException
– SQLDataException
– SQLIntegrityConstraintViolationException
– SQLInvalidAuthorizationSpecException
– SQLSyntaxException
An SQLTransientException is thrown when an SQL operation that failed
previously might succeed when the operation is retried, without intervention
from the application. A connection is still valid after an SQLTransientException
is thrown. The SQLTransientException class has these subclasses:
– SQLTransientConnectionException
– SQLTransientRollbackException
– SQLTimeoutException
An SQLRecoverableException is thrown when an operation that failed previously
might succeed if the application performs some recovery steps, and retries the
transaction. A connection is no longer valid after an SQLRecoverableException is
thrown.
A SQLClientInfoException is thrown by the Connection.setClientInfo method
when one or more client properties cannot be set. The SQLClientInfoException
indicates which properties cannot be set.
null

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents