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

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

Version information
Overview
Feature enhancements
Bug fixes

Version information

  • Release date: August 18, 2023
  • Version: V2.4.5

Overview

OceanBase Connector/J V2.4.5 supports PreparedStatement objects that return AutoGeneratedKey and allows the server to detect the client version.

Feature enhancements

  • The server can detect the proxy and client versions.
  • PreparedStatement objects that return AutoGeneratedKey are supported.

    Note

    To use a PreparedStatement object to return AutoGeneratedKey, make sure that the version of OceanBase Connector/J is V2.4.5 or later and add useOraclePrepareExecute=true to the connection string.

  • The following table describes the URL parameter changes.
Parameter
Status
Default value
Description
Remarks
compatibleOjdbcVersion New 6 The compatible Oracle JDBC driver version, which can be set to 6 or 8. If you set the value of this parameter to another integer, the system does not return an error but still applies the default value.
useInformationSchema New false Specifies whether the driver uses INFORMATION_SCHEMA to derive information used by DatabaseMetaData.
compatibleMysqlVersion New 5 The compatible MySQL Connector/J version, which can be set to 5 or 8. If you set the value of this parameter to another integer, the system does not return an error but still applies the default value.
useOraclePrepareExecute Optimized false Specifies whether to enable both the PreparedStatement and PrepareExecute protocols. In Oracle mode, a PreparedStatement object does not communicate with the server before being executed by using COM_STMT_PREPARE_EXECUTE. In the current version, when useOraclePrepareExecute is set to true, useServerPrepStmts is automatically set to true. Prior to OceanBase Connector/J V2.4.5, you can enable both the PreparedStatement and PrepareExecute protocols only by manually setting both useOraclePrepareExecute and useServerPrepStmts to true.

Bug fixes

  • Fixed the issue caused by Oracle compatibility processing of the getSchema() method.
  • Fixed the issue where an error is returned when the JDBC driver tries to establish a connection with the proxy after the SSL protocol and OceanBase Protocol 2.0 are enabled.
  • Fixed the issue where the error "out of range for column" is returned when useServerPrepStmts is set to false for OceanBase Connector/J.
  • Fixed the issue where the getInt() or getLong() method does not throw an exception after obtaining overlong data even though jdbcCompliantTruncation=true is configured.
  • Fixed the issue where the getString() and getTimestamp() methods return null for the zero value of the datetime type. This issue was caused by server modifications.
  • Fixed the issue where the zero value of the datetime type obtained by the getString() method is different from that in MySQL Connector/J 8.0.

Previous topic

OceanBase Connector/J V2.4.8
Last

Next topic

OceanBase Connector/J V2.4.4
Next
on this page
Version information
Overview
Feature enhancements
Bug fixes