You can find this information both in Appendix C and in the section “Under- standing Connector/J” later in this chapter. The interfaces specifically defined
in version 3.0 of the specification are shown in italics. The full Javadoc can be found at http://java.sun.com/j2se/1.4/docs/api/java/sql/package-summary.html.
java.sql.Array:The Array interface is a mapping between the Java lan- guage and the SQL ARRAY type. The interface includes methods for bring- ing an ARRAY value to a client as a Java array or in a ResultSet.
java.sql.BatchUpdateException:The BatchUpdateException is thrown when a batch update operation has failed. The exception includes all of the successful update commands that executed before the failure.
java.sql.Blob:The Blob Java interface is a mapping to the SQL BLOB value.
java.sql.CallableStatement:The CallableStatement interface is used to execute stored procedures if supported on the database. Parameters are allowed with the interface as well as escape syntax.
java.sql.Clob:Clob is a mapping from the Java programming language to the SQL CLOB type. A CLOB is a Character Large Object.
java.sql.Connection:The Connection interface provides a method for cre- ating a connection to a specific database. All SQL is executed in the context of a Connection object.
java.sql.DataTruncation:The DataTruncaction exception is thrown when data will be truncated. On a write, the exception is an error, but on a read, the exception is a warning.
java.sql.DatabaseMetaData:The DatabaseMetaData interface is designed to provide information about the remote database that a connection has been made to previously. The information available to the DatabaseMeta- Data object will be different based on the database vendor and the informa- tion it wants to provide.
java.sql.Date:The Date class is a wrapper for JDBC to use as a map to the SQL DATE value. The value of Date is the number of milliseconds since Jan- uary 1, 1970, 00:00:00:000 GMT.
A thin wrapper around a millisecond value that allows JDBC to identify this as an SQL DATE value. A milliseconds value represents the number of mil- liseconds that have passed since January 1, 1970, 00:00:00.000 GMT. java.sql.Driver:The Driver interface is implemented by all vendor drivers so that they can be loaded by a static class called DriverManager. The Dri- ver object will automatically create an instance of itself and register with DriverManager.
java.sql.DriverManager:The DriverManager class is used to manage all Driver objects.
java.sql.DriverPropertyInfo:The DriverPropertyInfo class provides information for advanced developers who need to set specific properties for loading a Driver object.
java.sql.ParameterMetaData:The ParameterMetaData interface provides information about the parameters in a PreparedStatement object.
java.sql.PreparedStatement:The PreparedStatement interface provides an object for executing precompiled SQL statements against the connected database.
java.sql.Ref:The Ref interface is a mapping between Java and an SQL REF value. A REF value is a reference to an SQL structured type value.
java.sql.ResultSet:A ResultSet interface is designed to represent a Result- Set produced from a query of the database. An internal cursor points to the current row of data, and it can be pointed before and after the data. Meth- ods are used to move the cursor to different rows in the ResultSet. By default, the ResultSet isn't updatable, but can be made both scrollable and updatable.
java.sql.ResultSetMetaData:The ResultSetMetaData interface is used to return specific information about the data within a ResultSet object. The information could include the number of columns, column names, float col- umn precision, and total column size, among other data.
java.sql.Savepoint:The Savepoint interface is used along with transac- tions to provide rollback points. This allows for the completion of large transactions even when an error occurs.
java.sql.SQLData:The SQLData interface is used to map the SQL user- defined type to the Java language.
java.sql.SQLException:The SQLException exception will be thrown when an error occurs during an attempt to access a database or when the database itself returns an error.
java.sql.SQLInput:The SQLInput interface is used by the developer of a JDBC driver to stream values from the database results. The interface isn’t designed to be instantiated by the application developer.
java.sql.SQLOutput:The SQLOutput interface is used by the developer of a JDBC driver to stream data to the database. The interface isn’t designed to be instantiated by the application developer.
java.sql.SQLPermission:The SQLPermission interface is designed to allow the driver to determine its permission when an applet calls the Driver- Manager.setLogWriter or setLogStream methods.
java.sql.SQLWarning:The SQLWarning interface is used to return any database access warnings from the database. Warnings are available in the Connection, Statement, and ResultSet objects.
java.sql.Statement:The Statement interface is probably one of the most important interfaces in the JDBC specification. All SQL statements are exe- cuted through a Statement object. Each Statement object returns single ResultSet objects.
java.sql.Struct:The Struct interface is a mapping from a SQL structured type to the Java language.
java.sql.Time:The Time class is a wrapper around java.util.Date to sup- port the mapping from SQL TIME to Java.
java.sql.Timestamp:The Timestamp class is a wrapper around java.util.Date to support the mapping from SQL TIMESTAMP to Java.
java.sql.Types:The Types class is an internal class used to identify generic SQL types or JDBC types.
The classes and interfaces within the Core API are linked together, as shown in Figure 2.4. There is a natural progression from a Connection object to a Result- Set. The path from one to the other occurs using a Statement, PreparedState- ment, or CallableStatement; and the Statement class is a parent to both of the others. All of the Statement classes will eventually execute SQL to produce a ResultSet. ResultSet Connection DataTypes Statement Prepared Statement Callable Statement createStatement executeQuery
Figure 2.4 JDBC Core API class/interface links.