All Products
Search
Document Center

ApsaraDB for OceanBase:Overview

Last Updated:Nov 16, 2023

This section describes how to connect to and access an Oracle tenant of OceanBase Database. Currently, you can connect to an OceanBase database by using a client, a driver, or an Object Relational Mapping (ORM) framework.

Clients

You can use one of the following clients to connect to an Oracle tenant of OceanBase Database:

  • OBClient

    OBClient is an interactive and batch query CLI tool that supports both MySQL tenants and Oracle tenants of OceanBase Database. You can visit Software Center to download and install OBClient.

    Before you use OBClient to connect to an OceanBase Database tenant, you must specify the connection information of the tenant. After you connect to OceanBase Database, you can use OBClient to run some database commands (including general Oracle commands) and execute some SQL and PL/SQL statements for the following purposes:

    • Calculating, storing, and generating query results

    • Creating database objects and checking and modifying object definitions

    • Developing and running batch processing scripts

    • Managing databases and modifying parameters

    For more information about how to use OBClient to connect to an OceanBase Database tenant, see Connect to an OceanBase Database tenant by using OBClient.

  • ODC

    ODC is an enterprise-level database development platform tailored for OceanBase Database. You can access ODC in the Apsara for OceanBase console.

    ODC is compatible with both MySQL and Oracle tenants in OceanBase Database. It provides database developers with various features, such as daily development, WebSQL-based workspace, SQL diagnostics, session management, and data import and export.

    For more information about how to use ODC to connect to an OceanBase Database tenant, see Connect to an OceanBase database by using ODC.

Drivers

You can use one of the following drivers to connect to an Oracle tenant of OceanBase Database:

  • OceanBase Connector/J

    OceanBase Connector/J uses the standard Java Database Connectivity (JDBC) APIs for Java programs to connect to OceanBase Database.

    JDBC is a Java standard that provides an API for connecting Java programs to a relational database. Developed by Sun Microsystems, the JDBC standard uses the standard java.sql interface to allow programs use their JDBC drivers for implementation and extension. JDBC is a call-level interface (CLI) based on X/Open SQL.

    OceanBase Connector/J is a JDBC Type 4 driver and can communicate with database engines directly over local protocols. OceanBase Connector/J is compatible with the OB2.0 protocol.

    OceanBase databases support OceanBase Connector/J. It automatically identifies whether an OceanBase database runs in MySQL or Oracle mode and supports both modes at the protocol layer.

    Important

    When a JDBC driver is connected, an oceanBase database checks the tenant name to determine whether the tenant runs in MySQL or Oracle mode. Tenants in Oracle mode are allowed to use only Oracle-compatible SQL syntax.

    OceanBase Connector/J supports the standard JDBC API. In addition, it is compatible with Oracle JDBC Driver. OceanBase Database in Oracle mode is compatible with most Oracle syntax.

    OceanBase Connector/J can be installed with one click. The installation package is named oceanbase-client-[Version No.].jar.

    Visit the official website of OceanBase and choose Resources > Download > OceanBase Cloud > Middleware. Click a version in OceanBase Connector/J to download.

    For more information about how to use MySQL Connector/J to connect to an OceanBase Database tenant, see Connect to an OceanBase database by using a JDBC driver.

  • OBCI

    OceanBase Call Interface (OBCI) is a C language tool for interface calls in OceanBase Database. It provides features that are fully compatible with Oracle Call Interface (OCI).

    OBCI allows you to operate and maintain data in an OceanBase database by using the C language. OBCI provides standard database access features in the form of a dynamic-link library (OBCI library). Applications can use the features by connecting to this library.

    OBCI is a C language call interface provided by OceanBase. It provides features that are compatible with OCI. If you want to use C code written by using Oracle OCI, you need only to specify the OBCI library as the runtime library during linking. By default, library files are installed in the /u01/obclient/lib path.

    To obtain the installation package of the OBCI driver, contact OceanBase Technical Support. For more information about how to use OceanBase Connector/C to connect to an OceanBase database, see Connect to an OceanBase database by using OBCI.

ORM framework

Object Relational Mapping (ORM) is a technique used in object-oriented programs that convert data between systems of different types. In effect, ORM creates a "virtual object database" that can be used within programming languages.

When you use the JDBC-based ORM framework to connect to an Oracle tenant of OceanBase Database, you can refer to the following documents: