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 #92 background imageLoading...
Page #92 background image
v The SQLSTATE
getThrowable
Returns a java.lang.Throwable object that caused the SQLException, or null, if
no such object exists.
printTrace
Prints diagnostic information.
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
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
v SQLTransientException
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
v SQLRecoverableException
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.
v SQLClientInfoException
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.
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
null
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
â„¢

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