OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.3.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.3.0
    iconOceanBase Database
    SQL - V 4.3.0
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Overview

    Last Updated:2026-04-15 08:30:00  Updated
    Share
    What is on this page
    Connect to OceanBase Database
    Connect to OceanBase Database using a driver or an ORM framework
    C
    Java
    Connection pools

    folded

    Share

    This topic describes how to connect to and access OceanBase Database in Oracle mode. Currently, you can connect to OceanBase Database using an Oracle client, an Oracle driver, an ORM framework, or a connection pool.

    Connect to OceanBase Database

    When you connect to an Oracle tenant of OceanBase Database, the following clients are supported:

    • OceanBase Client (OBClient)

      OBClient is an interactive query tool that supports batch processing. It must be installed separately. OBClient provides a command-line interface and can be used as the client in a database connection. It supports both Oracle and MySQL tenants in OceanBase Database.

      Before OBClient runs, you need to specify the connection information of the OceanBase tenant. After you connect to OceanBase Database, you can use OBClient to run some database commands (including general MySQL commands) and execute SQL and PL/SQL statements to accomplish the following tasks:

      • Calculate, store, and print query results

      • Create database objects, verify and modify object definitions

      • Develop and run batch processing scripts

      • Manage databases and modify parameters

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

    • OceanBase Developer Center (ODC)

      OceanBase Developer Center (ODC) is an enterprise-level database development platform tailored for OceanBase Database.

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

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

    Connect to OceanBase Database using a driver or an ORM framework

    C

    • C driver

      • OBCI

        OceanBase Call Interface (OBCI) is a C language interface compatible with Oracle Call Interface (OCI). OBCI provides features fully compatible with OCI.

        With OBCI, you can use the C language to operate data in OceanBase Database. It provides standard database access features in the form of a dynamic-linked library (OBCI library). Applications link with this library at runtime to use these features.

        OceanBase provides OBCI, a C calling interface compatible with Oracle OCI, to offer features compatible with OCI. If you write a C language application using Oracle OCI, you need only replace OCI with OBCI in the linking stage. The default installation path of this library is /u01/obclient/lib.

        For more information about how to connect C applications to OceanBase Database, see Connect a C application to OceanBase Database.

      • ODBC

        Open Database Connectivity (ODBC) is a standard database access interface. It allows you to connect to and operate different types of databases in a unified way. The ODBC driver provided by OceanBase allows applications to use standard SQL syntax to interact with OceanBase Database, without revealing the underlying implementation details. With ODBC, you can develop applications in multiple programming languages (such as C and C++) and achieve compatibility and flexibility across databases. You can easily connect to OceanBase in various environments, simplify the data access process, and increase your development efficiency by using the ODBC driver.

        For more information about how to connect to OceanBase Database by using ODBC, see Connect a C application to OceanBase Database.

    • C ORM framework

      • SqlSugar

        SqlSugar is a concise and easy-to-use C# ORM (Object-Relational Mapping) framework designed to help developers perform database operations quickly and efficiently. SqlSugar provides powerful data querying and manipulation capabilities, supporting various mainstream databases, including OceanBase. With SqlSugar, developers can execute complex database operations using simple C# code, avoiding the hassle of writing cumbersome SQL statements, thus improving development efficiency.

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

    Java

    • Java driver

      • OceanBase Connector/J

        OceanBase Connector/J provides a driver for Java applications to connect to OceanBase Database. It uses the standard Java Database Connectivity (JDBC) API.

        Java Database Connectivity (JDBC) is a Java standard that provides interfaces for connecting Java applications to relational databases. JDBC is defined by Sun Microsystems and implemented through the standard java.sql interface. It allows third-party providers to implement and extend the standard through 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 communicates directly with the database engine through a local protocol. It is compatible with the OB2.0 protocol.

        OceanBase Database supports OceanBase Connector/J, and is fully compatible with native JDBC drivers for MySQL (MySQL Connector Java). OceanBase Connector/J is fully compatible with MySQL JDBC drivers and can automatically identify whether OceanBase Database is operating in MySQL or Oracle mode. It is also protocol-compatible with both modes.

        Notice

        OceanBase Database identifies the operating mode as MySQL or Oracle based on the tenant name of the JDBC driver. In Oracle mode, only SQL syntaxes compatible with Oracle are supported by the tenant.

        In addition to supporting standard Java Database Connectivity (JDBC) application programming interfaces (APIs), OceanBase Connector/J also supports APIs used in Oracle drivers. As a result, OceanBase Database in Oracle mode is compatible with most SQL syntaxes in Oracle.

        OceanBase Connector/J uses a one-click installation mode. The driver installation package name is: oceanbase-client-[version].jar.

        Download the OceanBase Connector/J driver. On the Resources > Download Center > Enterprise Edition > Drivers and Middleware page of OceanBase Database's official website, click OceanBase JDBC driver to download the installation package of OceanBase Connector/J. For more information about the installation steps, see OceanBase Connector/J.

        For more information about how to connect Java applications to OceanBase Database, see Connect Java applications to OceanBase Database.

      • SpringJDBC

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

    • Java ORM frameworks

      • SpringBoot

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

      • SpringBatch

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

      • SpringJPA

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

      • Hibernate

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

      • MyBatis

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

      • Jfinal

        For more information about how to connect to OceanBase Database by using Jfinal, see Connect to OceanBase Database by using MyBatis.

    Connection pools

    OceanBase Database supports multiple connection pool implementations. You can select a suitable connection pool implementation based on your business characteristics.

    • Tomcat
    • c3p0
    • Proxool
    • HikariCP
    • DBCP
    • Commons Pool
    • Druid

    Previous topic

    Data truncated while being inserted, with ERROR 1265 reported
    Last

    Next topic

    Connect to an OceanBase tenant by using OBClient
    Next
    What is on this page
    Connect to OceanBase Database
    Connect to OceanBase Database using a driver or an ORM framework
    C
    Java
    Connection pools