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.2.1

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive 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.2.1
    iconOceanBase Database
    SQL - V 4.2.1
    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-28 09:23:26  Updated
    share
    What is on this page
    Connect to OceanBase Database by using a client
    Connect to OceanBase Database by using a driver
    Connect to OceanBase Database by using an ORM framework

    folded

    share

    This topic describes how to connect to the Oracle mode of OceanBase Database. Currently, you can connect to OceanBase Database by using a client, a driver, or an Object Relational Mapping (ORM) framework.

    Connect to OceanBase Database by using a client

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

    • OBClient

      OceanBase Client (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 Database. It supports Oracle and MySQL tenants in OceanBase Database.

      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 MySQL commands, and execute some SQL and PL/SQL statements for the following purposes:

      • Calculating, storing, and generating query results

      • Creating database objects, checking and modifying object definitions

      • Developing and running batch processing scripts

      • Managing databases and modifying parameters

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

    • 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 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 an OceanBase Database tenant by using ODC, see Connect to OceanBase Database by using ODC.

    Connect to OceanBase Database by using a driver

    You can connect to an Oracle tenant of OceanBase Database by using any of the following drivers:

    • Java driver (OceanBase Connector/J)

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

      JDBC is a Java standard that provides an API for connecting Java programs to a relational database. The JDBC standard is defined by Sun Microsystems and implemented through the standard java.sql API. Providers can implement and extend the standard 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 OB2.0 protocol.

      OceanBase 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 and can automatically determine whether OceanBase Database runs in MySQL or Oracle mode. It provides compatibility for both modes at the protocol level.

      Notice

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

      OceanBase Connector/J is compatible with the standard JDBC API and Oracle Driver. The Oracle mode of OceanBase Database 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.

      To obtain the installation package of OceanBase Connector/J, go to 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 Database, see Build a Java application.

    • C 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 use the C language to manipulate data in OceanBase Database. 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 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.

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

    Connect to OceanBase Database by using an ORM framework

    ORM is a programming technique for data conversion between a relational database and an object-oriented programming language. This creates, in effect, a "virtual object database" that can be used from within the programming language.

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

    • Spring Boot

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

    • Spring Batch

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

    • Spring JDBC

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

    • Spring Data JPA

      For more information about how to connect to OceanBase Database by using Spring Data JPA, see Connect to OceanBase Database by using Spring Data JPA.

    • 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.

    Previous topic

    Data truncated while being inserted, with ERROR 1265 reported
    Last

    Next topic

    Connect to an OceanBase Database tenant by using OBClient
    Next
    What is on this page
    Connect to OceanBase Database by using a client
    Connect to OceanBase Database by using a driver
    Connect to OceanBase Database by using an ORM framework