The Java Database Connectivity (JDBC) API allows Java programmers to access data from any database. You can use the JDBC API to access almost any data source, from relational databases to spreadsheets and flat files. JDBC technology also provides a common foundation for the development of tools and alternate interfaces.
Packages of JDBC API:
The JDBC API is divided into two packages:
- java.sql
- javax.sql
java.sql package:
The java.sql package provides an API for using the Java programming language to access and process data stored in a data source (typically a relational database). This API includes a framework for dynamically installing different drivers to access various data sources.
Important classes & interfaces of java.sql:
classes/interface | Description |
---|---|
java.sql.BLOB | An SQL BLOB(Binary Large Object) value’s representation (mapping) in the Java programming language. |
java.sql.Connection | creates a connection (session) with a specific database. |
java.sql.CallableStatement | Execute stored procedures |
java.sql.CLOB | Provide the mapping in the Java programming language for the SQL CLOB (Character Large Object) type. |
java.sql.Date | Provide support for Date SQL type. |
java.sql.Driver | create the interface that every driver class must implement. |
java.sql.DriverManager | Provides the basic service for managing a set of JDBC drivers. |
java.sql.PreparedStatement | Used to create and execute parameterized queries. |
java.sql.ResultSet | It is an interface that provides methods to access the result row-by-row. |
java.sql.Savepoint | specify the representation of a savepoint, which is a point within the current transaction that can be referenced from the Connection.rollback method. |
java.sql.SQLException | Encapsulate all JDBC-related exceptions and provides information on a database access error or other errors. |
java.sql.Statement | This interface is used to execute SQL statements. |
DatabaseMetaData | In-depth information about the database as a whole. |
DriverAction | When a Driver needs to be notified by DriverManager, this interface must be implemented. |
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. |
SQLData | The interface is used to create a custom mapping from a SQL user-defined type (UDT) to a Java class. |
SQLInput | An input stream containing a stream of values representing an instance of a SQL structured type or a SQL distinct type. |
SQLOutput | The output stream for writing user-defined type attributes back to the database. |
SQLType | An object that identifies a generic SQL type, also known as a JDBC type or a vendor-specific data type. |
SQLXML | The mapping in the JavaTM programming language for the SQL XML type. |
Statement | The object is 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 a proxy class. |
javax.sql package:
This package provides an API for accessing and processing server-side data sources from the Java programming language.
Important classes & interfaces of javax.sql:
classes/interface | Description |
---|---|
javax.sql.ConnectionEvent | An Event object that provides information about the source of a connection-related event. |
javax.sql.ConnectionEventListener | An object that registers to be notified of events generated by a PooledConnection object. |
javax.sql.DataSource | provides a connection factory for the physical data source represented by this DataSource object. |
javax.sql.PooledConnection | provide objects to manage connection pools. |
CommonDataSource | This interface defines the methods that are shared by DataSource, XADataSource, and ConnectionPoolDataSource. |
RowSet | The interface that adds support to the JDBC API for the JavaBeans™ component model. |
RowSetInternal | A RowSet object implements this interface in order to present itself to a RowSetReader or RowSetWriter object. |
RowSetListener | An interface that must be implemented by any component that wishes to be notified when a significant event occurs during the lifetime of a RowSet object. |
RowSetMetaData | A RowSet object that contains information about the columns. |
RowSetReader | The method used by a disconnected RowSet object to populate itself with rows of data. |
RowSetWriter | A writer is an object that implements the RowSetWriter interface. |
StatementEventListener | An object that registers to receive notifications when events occur on PreparedStatements in the Statement pool. |
XAConnection | An object that supports distributed transactions. |
XADataSource | Internally used factory for XAConnection objects. |
Note: also read about the What is JDBC?
Follow Me
If you like my post, please follow me to read my latest post on programming and technology.
https://www.instagram.com/coderz.py/
https://www.facebook.com/coderz.py
Staying up to the mark is what defines me. Hi all! I’m Rabecca Fatima a keen learner, great enthusiast, ready to take new challenges as stepping stones towards flying colors.
Leave a Comment