Overview

2025-07-04 09:38:42  Updated

This topic describes how to connect to OceanBase Cloud in the Oracle compatible mode. You can connect to OceanBase Cloud by using a client, driver, ORM framework, or connection pool.

Clients

You can connect to an Oracle-compatible tenant of OceanBase Cloud by using any of the following clients:

  • OceanBase Client (OBClient)

    OBClient is an interactive query tool that supports batch processing. It must be installed separately. OBClient provides a CLI and acts as the client when it is connected to OceanBase Cloud. It supports Oracle-compatible tenants of OceanBase Cloud.

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

    • Calculate, store, and generate query results

    • Create database objects and check and modify object definitions

    • Develop and run batch scripts

    • Manage databases and modify parameters

    For more information about how to connect to OceanBase Cloud by using OBClient, see Connect to OceanBase Cloud by using OBClient.

  • OceanBase Developer Center (ODC)

    ODC is an enterprise-level database development platform tailored for OceanBase Cloud.

    ODC supports connecting to both MySQL-compatible and Oracle-compatible tenants of OceanBase Cloud. 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 connect to OceanBase Cloud by using ODC, see Connect to OceanBase Cloud by using Client ODC.

Drivers

  • Java driver (OceanBase Connector/J)

    OceanBase Connector/J uses the standard Java Database Connectivity (JDBC) API to connect Java applications to OceanBase Cloud.

    JDBC is a Java standard that provides an API for connecting Java applications to a relational database. The JDBC standard was defined by Sun Microsystems and is implemented by the standard java.sql API. Providers can implement and extend it by using their own JDBC drivers. JDBC is a Call Level Interface (CLI) based on X/Open SQL.

    OceanBase Connector/J is a JDBC Type 4 driver that can be connected to a database engine by using local protocols. OceanBase Connector/J is compatible with the OceanBase 2.0 protocol.

    Notice

    OceanBase Cloud determines whether to run in the MySQL compatible mode or the Oracle compatible mode based on the tenant name that is used when the JDBC driver is connected to the database service. Tenants in the Oracle compatible mode can use only Oracle-compatible SQL syntaxes.

    OceanBase Connector/J is compatible with standard JDBC APIs and Oracle Driver. OceanBase Cloud in the Oracle compatible mode is compatible with most Oracle syntaxes.

    OceanBase Connector/J can be installed with a few clicks. The installation package is named oceanbase-client-[Version number].jar.

    You can download the installation package of OceanBase Connector/J from OceanBase Download Center. For more information about the installation procedure, see OceanBase Connector/J.

    For more information about how to connect Java applications to OceanBase Cloud, see Connect to OceanBase Cloud by using OceanBase Connector/J.

  • C drivers

    • OBCI

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

      OBCI allows you to use the C language to manipulate data in OceanBase Cloud. 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 a C application written by using Oracle OCI, you only need to specify the OBCI library as the runtime library during linking. By default, library files are installed in the /u01/obclient/lib path.

      For more information about how to connect C applications to OceanBase Cloud, see Connect to OceanBase Cloud by using OceanBase Connector/C.

    • ODBC

      Open Database Connectivity (ODBC) is a standard database access interface that allows you to connect and operate different types of databases using a unified approach. OceanBase provides an ODBC driver that allows applications to interact with OceanBase Database using standard SQL syntax, without needing to concern themselves with the underlying implementation details. With ODBC, you can develop applications in various programming languages (such as C and C++) to achieve compatibility and flexibility across different databases. ODBC enables developers to easily connect to OceanBase in various environments, simplifying data access and improving development efficiency.

      For more information about how to connect to OceanBase Database by using ODBC, see Connect to OceanBase Cloud by using OceanBase Connector/ODBC.

  • C ORM framework

    • SqlSugar

      SqlSugar is a concise and user-friendly object-relational mapping (ORM) framework for C#. It is designed to help developers quickly and efficiently perform database operations. SqlSugar provides powerful data query and operation features and supports multiple mainstream databases, including OceanBase Database. With SqlSugar, developers can use simple C# code to perform complex database operations, avoiding the need to write lengthy SQL statements and improving development efficiency.

      For more information about how to connect to OceanBase Database by using SqlSugar, see Connect to OceanBase Cloud by using SqlSugar.

ORM frameworks

ORM is a programming technique that converts data between different types of systems by using object-oriented programming languages. In effect, ORM creates a "virtual object database" that can be used within programming languages.

You can connect to an Oracle-compatible tenant of OceanBase Cloud by using any of the following ORM frameworks:

Connection pools

Database connection pool configuration is an important step in ensuring efficient and stable connections between the system and the database. A well-optimized connection pool can effectively manage the number of database connections, preventing connection exhaustion in high-concurrency scenarios. It can also promptly remove invalid connections based on timeout settings, ensuring system performance.

OceanBase Cloud supports various connection pools. You can select one based on your business needs.

Contact Us