background image
<< JDBC 4.0 and 4.1 features | java.sql.Statement interface >>

Refined subclasses of SQLException

<< JDBC 4.0 and 4.1 features | java.sql.Statement interface >>
Derby Reference Manual
321
the DriverManager will find an appropriate JDBC driver when the application
requests a Connection.
· SQLExceptions. JDBC 4.0 introduces refined subclasses of SQLException. See
Refined subclasses of SQLException
.
· Wrappers. JDBC 4.0 introduces the concept of wrapped JDBC objects. This is
a formal mechanism by which application servers can look for vendor-specific
extensions inside standard JDBC objects like Connections, Statements, and
ResultSets. For Derby, this is a vacuous exercise because Derby does not expose
any of these extensions.
· Statement events. With JDBC 4.0, Connection pools can listen for
Statement closing and Statement error events. New methods were
added to javax.sql.PooledConnection: addStatementEventListener and
removeStatementEventListener.
· Streaming APIs. JDBC 4.0 adds new overloads of the streaming methods in
CallableStatement, PreparedStatement, and ResultSet. These are the setXXX and
updateXXX methods which take java.io.InputStream and java.io.Reader arguments.
The new overloads allow you to omit the length arguments or to specify long
lengths.
· New methods. New methods were added to the following interfaces:
javax.sql.Connection
,
javax.sql.DatabaseMetaData
, and
javax.sql.Statement
. See
java.sql.Connection interface: JDBC 4.0 features
,
java.sql.DatabaseMetaData interface: JDBC 4.0 features
,
java.sql.Statement
interface: JDBC 4.0 features
.
Refined subclasses of SQLException
If your application runs on JDK 1.6 or higher, exceptions raised by Derby will generally be
one of the refined subclasses of SQLException, introduced by JDBC 4.0. These refined
exceptions are raised under the conditions described by their respective javadoc.
· java.sql.SQLClientInfoException
· java.sql.SQLDataException
· java.sql.SQLFeatureNotSupportedException
· java.sql.SQLIntegrityConstraintViolationException
· java.sql.SQLInvalidAuthorizationSpecException
· java.sql.SQLSyntaxErrorException
· java.sql.SQLTransactionRollbackException
· java.sql.SQLTransientConnectionException
java.sql.Connection interface: JDBC 4.0 features
JDBC 4.0 adds new capabilities to Connections:
· LOB creation - New methods, createBlob() and createClob() let you create empty
Blobs and Clobs, which you can then fill up before stuffing into a column.
· Validity tracking - The isValid method tells you whether your Connection is still
alive.
java.sql.DatabaseMetaData interface: JDBC 4.0 features
Derby implements all of the new metadata methods added by JDBC 4.0.
· Capability reports - JDBC 4.0 adds new methods for querying the capabilities
of a database. These include autoCommitFailureClosesAllResultSets,
providesQueryObjectGenerator, getClientInfoProperties, and
supportsStoredFunctionsUsingCallSyntax.
· Column metadata - The getColumns method reports IS_AUTOINCREMENT =
YES if a column is generated.