OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Connector/J

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

Document Feedback
  1. Documentation Center
  2. OceanBase Connector/J
  3. V2.4.15

OceanBase Connector/J V2.4.15

Last Updated:2026-09-04 08:24:26

Version overview
New features
Change in URL parameters
Fix defects

Publish date: July 2, 2025 Version: V2.4.15

Version overview

JDBC V2.4.15 introduces multiple parameters, enhancing compatibility with MySQL and Oracle. In MySQL mode, the new parameter useLocalSessionState controls whether JDBC uses locally cached session states to avoid frequent query requests to OBServer. In Oracle mode, the new parameter lowercaseRoutinesInMetadata controls whether names are required to be in uppercase when retrieving procedure/function metadata using interfaces like getProcedures or getFunctions. Additionally, the Set/Get ClientInfo interface has been optimized by using local caching, eliminating the need for frequent requests to OBServer, thereby reducing database resource overhead.

New features

  • Optimized the Get/Set ClientInfo interface by implementing local caching, reducing the need for frequent requests to the OBServer and minimizing the database resource overhead.
  • MySQL Tenant
    • A new parameter useLocalSessionState is added to control whether JDBC uses cached session state (such as transaction mode, auto-commit status, and current database) to avoid frequent queries sent to OBServer. If the value is False, the query will be sent. If the value is True, a query will be sent only when the session state changes. Note that JDBC versions earlier than V2.4.15 do not have this parameter, and the behavior of sending queries when session state changes is equivalent to setting useLocalSessionState=true, so the default value of this parameter is set to True.
  • Oracle tenancy
    • Adds the new parameter lowercaseRoutinesInMetadata to control whether getProcedures or getFunctions can retrieve routine metadata based on lowercase names. The default value is true, indicating that it supports retrieving metadata based on lowercase names.
    • In Oracle mode, only binary_double is the real double type, while other standard double types should be converted to numbers. Currently, the setDouble interface sends double-type data to the database, which cannot be distinguished from the setBinary_double interface. JDBC V2.4.15 changed the serialized data type of the setDouble interface to Number, which differentiates it from the setBinary_double interface.
    • Added a parameter named convertNoneNanoSecsToDate to indicate whether to convert the values of timestamp fields with different levels of precision to the Date type.

Change in URL parameters

Add the following URL parameters:

Name
Status
Default value
Description
oracleXaPrepareThrowException Added false Throw an exception when the return value of dbms_xa.xa_prepare is not 0 or 3
useLocalSessionState New true Controls whether the driver uses the cached session state (such as transaction mode, auto-commit mode, and current database) locally to avoid frequent queries to the server for this state. This is set to false by default for MySQL-JDBC.
convertNoneNanoSecsToDate Added true When the nanos parameter is set to 0 when calling the setTimestamp interface in Oracle mode, the parameter is converted to the Date type.
oracleUseNumberForSetDouble New false For an Oracle tenant, whether to serialize the type of setDouble to the number type.
lowercaseRoutinesInMetadata Added true Whether to use lowercase for the name of procedures and functions in metadata of an Oracle tenant.

Fix defects

Here are the main fixes from this release:

  • Fix error when connecting without importing the timezone table in Oracle mode.
  • Fixed an issue where when calling a stored procedure across users, incorrect output parameter values were produced if the output parameters were not registered.
  • Optimize the getcolumns interface implementation to improve execution performance.
  • Fixed the issue where data is inconsistent when re-executing the stored procedure with incomplete data from the previous request.
  • Fixed an issue where occasional type conversion failures could occur in nested arrays with CLOB data types
  • Fix issues where frequent creation and closing of PreparedStatement leads to exceeding the cursor limit due to pstmts not being promptly closed after a cursor result set is created.
  • Fixed the issue where the PS didn't close in the PS combination mode when the arraybinding failed.
  • Fixed the issue where when only one row of data exists in the database and a combined protocol and cursor result set are used, ResultSet.isAfterLast() returns the wrong result.
  • Fixed the issue where, when a function comment is a single string, the getFunctionColumns interface returns an incorrect value.
  • Fixes errors on data truncation when the jdbcCompliantTruncation=false parameter is set.
  • Fix the error when using public synonyms across users.
  • Fixed an issue where when rewriteBatchedStatements is set to true in MySQL mode and the on duplicate key update statement includes \n, the result of getGeneratedKeys is incorrect.
  • Fixed an issue where executeBatch returns an incorrect value when inserting two rows with the same value using the ON DUPLICATE KEY UPDATE statement.
  • Fixed the issue where anonymous arrays nested in a record cause an error with the JDBC driver indicating an unknown complex data type.
  • Fixed incorrect statement concatenation when calling setBlob with useServerPrepStmts=true in the MySQL mode.
  • Fixed the issue where the releaseSavepoint interface in Oracle mode causes an interruption in HikariCP due to incompatibility between errCode and SqlState with Oracle.
  • Fixed a problem in Oracle mode where the out parameter is not properly registered, causing the get method to return incorrect result values.
  • Fixes the issue where the PL returns the correct number of updated rows, but the client calculates it incorrectly.

Previous topic

com.oceanbase.jdbc.ObPrepareStatement
Last

Next topic

OceanBase Connector/J V2.4.14
Next
on this page
Version overview
New features
Change in URL parameters
Fix defects