JDBC API
JDBC API is mainly divided into two package. Each when we are using JDBC, we have to import these packages to use classes and interfaces in our application.
java.sql
javax.sql
java.sql package
This package include classes and interface to perform almost all JDBC operation such as creating and executing SQL Queries.
Important classes and interface of java.sql
package
classes/interface | Description |
java.sql.BLOB | Provide support for BLOB(Binary Large Object) SQL type. |
java.sql.Connection | creates a connection with specific database |
java.sql.CallableStatement | Execute stored procedures |
java.sql.CLOB | Provide support for CLOB(Character Large Object) SQL type. |
java.sql.Date | Provide support for Date SQL type. |
java.sql.Driver | create an instance of a driver with the DriverManager. |
java.sql.DriverManager | This class manages database drivers. |
java.sql.PreparedStatement | Used to create and execute parameterized query. |
java.sql.ResultSet | It is an interface that provide methods to access the result row-by-row. |
java.sql.Savepoint | Specify savepoint in transaction. |
java.sql.SQLException | Encapsulate all JDBC related exception. |
java.sql.Statement | This interface is used to execute SQL statements. |
DatabaseMetaData |
Comprehensive information about the database as a whole. |
DriverAction |
An interface that must be implemented when a Driver wants to be notified by DriverManager. |
ResultSetMetaData |
An object that can be used to get information about the types and properties of the columns in a ResultSet object. |
RowId |
The representation (mapping) in the Java programming language of an SQL ROWID value. |
Savepoint |
The representation of a savepoint, which is a point within the current transaction that can be referenced from the Connection.rollback method. |
SQLData |
The interface used for the custom mapping of an SQL user-defined type (UDT) to a class in the Java programming language. |
SQLInput |
An input stream that contains a stream of values representing an instance of an SQL structured type or an SQL distinct type. |
SQLOutput |
The output stream for writing the attributes of a user-defined type back to the database. |
SQLType |
An object that is used to identify a generic SQL type, called a JDBC type or a vendor specific data type. |
SQLXML |
cThe mapping in the JavaTM programming language for the SQL XML type. |
Statement |
The object used for executing a static SQL statement and returning the results it produces. |
Struct |
The standard mapping in the Java programming language for an SQL structured type. |
Wrapper |
Interface for JDBC classes which provide the ability to retrieve the delegate instance when the instance in question is in fact a proxy class. |
The javax.sql package
This package is also known as JDBC extension API. It provides classes and interface to access server-side data.
Important classes and interface of javax.sql
package
classes/interface | Description |
javax.sql.ConnectionEvent | Provide information about occurence of event. |
javax.sql.ConnectionEventListener | Used to register event generated by PooledConnection object. |
javax.sql.DataSource | Represent the DataSource interface used in an application. |
javax.sql.PooledConnection | provide object to manage connection pools. |
CommonDataSource |
Interface that defines the methods which are common between DataSource, XADataSource and ConnectionPoolDataSource. |
RowSet |
The interface that adds support to the JDBC API for the JavaBeans™ component model. |
RowSetInternal |
The interface that a RowSet object implements in order to present itself to a RowSetReader or RowSetWriter object. |
RowSetListener |
An interface that must be implemented by a component that wants to be notified when a significant event happens in the life of a RowSet object. |
RowSetMetaData |
An object that contains information about the columns in a RowSet object. |
RowSetReader |
The facility that a disconnected RowSet object calls on to populate itself with rows of data. |
RowSetWriter |
An object that implements the RowSetWriter interface, called a writer. |
StatementEventListener |
An object that registers to be notified of events that occur on PreparedStatements that are in the Statement pool. |
XAConnection |
An object that provides support for distributed transactions. |
XADataSource |
A factory for XAConnection objects that is used internally. |