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 Connector/J

V2.4.16

  • What is OceanBase Connector J?
    • Overview of OceanBase Connector/J
    • Compatibility requirements
  • Install Driver
    • Install and load OceanBase Connector/J
  • Instructions
    • Quick start
      • Import packages
      • Establish a database connection
      • Create a Statement object
      • Run queries and retrieve ResultSet objects
      • Process ResultSet objects
      • Close ResultSet and Statement objects
      • Manage tables and data
      • Commit changes
      • Close a database connection
      • Examples
    • Data sources and URL
      • Data source overview
      • Database URL
    • Java data streams
      • Overview of Java data streams
      • LONG and LONG RAW data types
      • Use LOBs
        • Overview of LOB data types
        • LOB data interface
        • LOB locator interface
      • CHAR, VARCHAR, and RAW data types
    • Statement caching
      • Overview of statement caching
      • Use statement caching
      • Reuse statement objects
    • Call a stored procedure
    • Handle SQL exceptions
    • Result set
      • Overview of result sets
      • Limitations
      • FetchSize
      • refreshRow
      • useCursorFetch
    • Batch processing
    • Failover and Load-Balancing
      • Failover and load balancing modes
      • LoadBalance strategies
      • Load balancing strategy configuration methods
    • Rich client
    • Logging
    • Network overheads
    • Show Trace
    • Security features
    • Troubleshooting
  • Reference
    • Features specific to the Oracle mode
      • Binary Protocol (Prepared Statements)
        • COM_STMT_PREPARE_EXECUTE
        • COM_STMT_SEND_PIECE_DATA
      • Call PL stored procedures
      • Scrollability of a result set
      • Use ARRAY and STRUCT classes
      • Distributed transactions
        • Overview
        • XA components
        • Distributed transaction examples
      • Obtain remarks
      • Data types supported in Oracle mode
      • Error messages in Oracle mode
    • Supported SQL and PL data types
    • Common APIs
      • Overview
      • java.sql.Connection
      • java.sql.CallableStatement
      • java.sql.DatabaseMetaData
      • java.sql.Driver
      • java.sql.PreparedStatement
      • java.sql.ParameterMetaData
      • java.sql.ResultSet
      • java.sql.ResultSetMetaData
      • java.sql.Statement
      • javax.sql.ConnectionPoolDataSource
      • javax.naming.Context
      • javax.sql.PooledConnection
      • com.oceanbase.jdbc.ObPrepareStatement
  • Release Notes
    • V2.4
      • OceanBase Connector/J V2.4.16
      • OceanBase Connector/J V2.4.15
      • OceanBase Connector/J V2.4.14
      • OceanBase Connector/J V2.4.13
      • OceanBase Connector/J V2.4.12
      • OceanBase Connector/J V2.4.11
      • OceanBase Connector/J V2.4.8
      • OceanBase Connector/J V2.4.5
      • OceanBase Connector/J V2.4.4
      • OceanBase Connector/J V2.4.3
      • OceanBase Connector/J V2.4.2
      • OceanBase Connector/J V2.4.1
      • OceanBase Connector/J V2.4.0
    • V2.2
      • OceanBase Connector/J V2.2.11
      • OceanBase Connector/J V2.2.10
      • OceanBase Connector/J V2.2.7
      • OceanBase Connector/J V2.2.6
      • OceanBase Connector/J V2.2.3
      • OceanBase Connector/J V2.2.0

Download PDF

Overview of OceanBase Connector/J Compatibility requirements Install and load OceanBase Connector/J Import packages Establish a database connection Create a Statement object Run queries and retrieve ResultSet objects Process ResultSet objects Close ResultSet and Statement objects Manage tables and data Commit changes Close a database connection Examples Data source overview Database URL Overview of Java data streams LONG and LONG RAW data types CHAR, VARCHAR, and RAW data types Overview of statement caching Use statement caching Reuse statement objects Call a stored procedure Handle SQL exceptions Overview of result sets Limitations FetchSize refreshRow useCursorFetch Batch processing Failover and load balancing modes LoadBalance strategies Load balancing strategy configuration methods Rich client Logging Network overheads Show Trace Security features Troubleshooting Call PL stored procedures Scrollability of a result set Use ARRAY and STRUCT classes Obtain remarks Data types supported in Oracle mode Error messages in Oracle mode Supported SQL and PL data types Overview java.sql.Connection java.sql.CallableStatement java.sql.DatabaseMetaData java.sql.Driver java.sql.PreparedStatement java.sql.ParameterMetaData java.sql.ResultSet java.sql.ResultSetMetaData java.sql.Statement javax.sql.ConnectionPoolDataSource javax.naming.Context javax.sql.PooledConnection com.oceanbase.jdbc.ObPrepareStatement OceanBase Connector/J V2.4.16 OceanBase Connector/J V2.4.15 OceanBase Connector/J V2.4.14 OceanBase Connector/J V2.4.13 OceanBase Connector/J V2.4.12 OceanBase Connector/J V2.4.11 OceanBase Connector/J V2.4.8 OceanBase Connector/J V2.4.5 OceanBase Connector/J V2.4.4 OceanBase Connector/J V2.4.3 OceanBase Connector/J V2.4.2 OceanBase Connector/J V2.4.1 OceanBase Connector/J V2.4.0 OceanBase Connector/J V2.2.11 OceanBase Connector/J V2.2.10 OceanBase Connector/J V2.2.7 OceanBase Connector/J V2.2.6 OceanBase Connector/J V2.2.3 OceanBase Connector/J V2.2.0
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 Connector/J
  3. V2.4.16
iconOceanBase Connector/J
V 2.4.16
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
  • V 2.4.18
  • V 2.4.17
  • V 2.4.16
  • V 2.4.15
  • V 2.4.14
  • V 2.4.5
  • V 2.4.4
  • V 2.4.3
  • V 2.4.2
  • V 2.4.1
  • V 2.4.0
  • V 2.2.11
  • V 2.2.10
  • V 2.2.7
  • V 2.2.6
  • V 2.2.3
  • V 2.2.0

OceanBase Connector/J V2.4.15

Last Updated:2026-05-08 08:31:35  Updated
Share
What is on this page
Version overview
New features
URL parameter changes
Bug fix

folded

Share

Published Date: 2025-07-02 Version: V2.4.15

Version overview

JDBC V2.4.15 introduces multiple parameters to enhance compatibility with MySQL and Oracle. In MySQL mode, it introduces the useLocalSessionState parameter to control whether the JDBC client uses cached session state, reducing the frequency of queries sent to the OBServer. In Oracle mode, it adds the lowercaseRoutinesInMetadata parameter to control whether the names returned by getProcedures and getFunctions should be in lowercase. Additionally, the Set/Get ClientInfo interface has been optimized to use local caching, minimizing the need for frequent requests to the OBServer, thus reducing database resource overhead.

New features

  • Optimize the set/get client info interface to use local cache, reducing the number of frequent requests to OBServer and lowering database resource overhead.
  • MySQL tenant
    • Added the useLocalSessionState parameter to control whether the JDBC client uses cached session states (such as transaction mode, auto-commit status, and current database) to avoid frequent queries to OBServer. If the parameter value is False, queries are always sent. If the value is True and the session state has not changed, no requests are sent. Otherwise, requests are sent. This parameter was not available in JDBC versions earlier than V2.4.15. The default value is True, as in earlier versions, commands were sent to the server only when the session state changed.
  • Oracle tenant
    • The parameter lowercaseRoutinesInMetadata has been added to control whether to allow the getProcedures or getFunctions interface to retrieve procedure or function metadata with the name condition in lowercase. The default value is True, and it supports lowercase.
    • In Oracle mode, only binary_double is a real double type, and all other ordinary double types should be converted to number types. Currently, the setDouble interface in JDBC sends data of the double type, which cannot be distinguished from the setBinary_double interface. In JDBC V2.4.15, the serialization data type of the setDouble interface is changed to Number, differentiating it from setBinary_double.
    • Add the convertNoneNanoSecsToDate parameter to control whether to convert a timestamp field that contains values of different precisions to a date field.

URL parameter changes

Add the following URL parameter:

Option name
Status
Default value
Description
oracleXaPrepareThrowException Added false If dbms_xa.xa_prepare returns a value other than 0 or 3, an exception is thrown.
useLocalSessionState New true Controls whether the driver uses local caching of session state (such as transaction mode, auto-commit status, current database, etc.) to avoid frequent queries to the server to obtain these states. The default value for MySQL-JDBC is false.
convertNoneNanoSecsToDate Added true In Oracle mode, whether to convert the parameter values of the setTimestamp interface into Date objects when the values have no nanoseconds.
oracleUseNumberForSetDouble Added false For an Oracle tenant, whether to serialize setDouble to a number type.
lowercaseRoutinesInMetadata Added true Specifies whether to return the name in lowercase for routines such as procedure and function, when you obtain the metadata in the Oracle tenant.

Bug fix

The main issues fixed in this iteration are listed below:

  • Fixed an issue where, in Oracle mode, a connection error would occur if the time zone table was not imported.
  • Fixed a problem where the values of output parameters were incorrect when stored procedures were called across users without registering output parameters.
  • Optimize the implementation of the getcolumns interface to improve execution performance.
  • Fixed an issue where, when the PS cache is enabled and the cursor result set is used, if the data from the previous request is not fully fetched, the same PS is used to fetch new data, causing an abnormal state of the previously fetched data.
  • Fixed a rare issue where a type conversion failure can occur when an array contains nested CLOB data types.
  • Resolved an issue where frequently opening and closing PS and not closing the pstmt created for cursor results would lead to cursor limit exceeded.
  • Fixed the issue where, in a dual-stack (IPv4/IPv6) environment, the PS does not close correctly when an array binding execution fails.
  • Fixed an issue where ResultSet.isAfterLast() returned an incorrect result when only one record exists in the database, and the protocol and cursor are used.
  • Fixed the issue where getFunctionColumns returns an incorrect value when the function comment is a single string.
  • Fixed an issue where setting the parameter jdbcCompliantTruncation=false results in an error when data truncation occurs.
  • Fixed the error when using public synonyms across users.
  • Fix an issue where, in MySQL mode, when rewriteBatchedStatements is set to true and an on duplicate key update statement contains \n, the result of getGeneratedKeys is incorrect.
  • Fixed an issue in which executeBatch returned an incorrect value when two rows of values were inserted with the ON DUPLICATE KEY UPDATE statement.
  • Fix the error of unknown complex data type when anonymous arrays are nested in the JDBC driver.
  • Fixed an issue where an incorrect statement was generated when the setBlob method was called with useServerPrepStmts=true in MySQL mode.
  • Fixes the issue where the releaseSavepoint interface in Oracle mode is incompatible with Oracle, leading to a connection break in hikariCp.
  • Fixed the issue where, in Oracle mode, the incorrect registration of OUT parameters causes the get method to retrieve incorrect result values.
  • Fixed the issue where the client incorrectly calculates the number of rows returned by a PL update statement.

Previous topic

OceanBase Connector/J V2.4.16
Last

Next topic

OceanBase Connector/J V2.4.14
Next
What is on this page
Version overview
New features
URL parameter changes
Bug fix