Java Database Connectivity (JDBC) is a Java standard that provides an API for connecting Java programs to a relational database. OceanBase Connector/J is a driver that implements the JDBC API to provide connections to OceanBase AI Database for Java-based applications.
The JDBC standard was defined by Sun Microsystems and is implemented by the standard java.sql API. Providers can implement and extend the JDBC standard by using their own JDBC drivers. JDBC is a Call Level Interface (CLI) based on X/Open SQL.
OceanBase Connector/J as a driver
OceanBase Connector/J is a JDBC Type 4 driver that communicates directly with the database engine by using native protocols. OceanBase AI Database supports OceanBase Connector/J and is fully compatible with MySQL Connector Java, the native JDBC driver for MySQL. OceanBase Connector/J is fully compatible with MySQL JDBC usage and is compatible with MySQL mode at the protocol layer.
The OceanBase Connector/J driver is compatible with the OB2.0 protocol.
Key features
OceanBase Connector/J provides the following main components:
DriverManager: loads the driver and returns the corresponding connections based on call requests.
Driver: handles requests and returns the corresponding connections. It is loaded to DriverManager.
Connection: communicates with the database, provides a connection environment for executing SQL statements and handling transactions, and creates and executes statements.
Statement:
Statement: performs a single SQL query or update operation.
PreparedStatement: executes cached statements with predetermined execution paths. Cached statements can be repeatedly executed to improve efficiency.
CallableStatement: executes stored procedures in the database.
SQLException: displays errors that occur when a database connection is created or closed or when an SQL statement is executed.