Signup/Sign In

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.

  1. java.sql
  2. 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/interfaceDescription
java.sql.BLOBProvide support for BLOB(Binary Large Object) SQL type.
java.sql.Connectioncreates a connection with specific database
java.sql.CallableStatementExecute stored procedures
java.sql.CLOBProvide support for CLOB(Character Large Object) SQL type.
java.sql.DateProvide support for Date SQL type.
java.sql.Drivercreate an instance of a driver with the DriverManager.
java.sql.DriverManagerThis class manages database drivers.
java.sql.PreparedStatementUsed to create and execute parameterized query.
java.sql.ResultSetIt is an interface that provide methods to access the result row-by-row.
java.sql.SavepointSpecify savepoint in transaction.
java.sql.SQLExceptionEncapsulate all JDBC related exception.
java.sql.StatementThis 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/interfaceDescription
javax.sql.ConnectionEventProvide information about occurence of event.
javax.sql.ConnectionEventListenerUsed to register event generated by PooledConnection object.
javax.sql.DataSourceRepresent the DataSource interface used in an application.
javax.sql.PooledConnectionprovide 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.