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.2.10
  • What is OceanBase Connector J?
    • What's New
    • Compatibility requirements
    • Overview of OceanBase Connector/J
  • Install Driver
    • Install and load the OceanBase Connector/J driver
  • Instructions
    • Quick start
      • Import packages
      • Create 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
      • Example
    • Data sources and URL
      • Data source overview
      • Data source characteristics and properties
      • Create and connect to a data source instance
      • 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 API
      • CHAR, VARCHAR, and RAW data types
    • Statement caching
      • Overview of statement caching
      • Use statement caching
      • Reuse statement objects
    • Use CallableStatements to call stored procedures
    • Handle SQL exceptions
    • Result set
      • Overview of result sets
      • Limits
      • FetchSize
      • refreshRow
      • useCursorFetch
    • Batch processing
    • Failover and load balancing modes
    • Security features
    • SQL NetworkCostInfo
    • 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
      • Result set performance
      • Use ARRAY and STRUCT classes
      • Distributed transactions
        • Overview of distributed transactions
        • XA components
        • Distributed transaction examples
      • Error messages in Oracle mode
      • Data types supported in Oracle mode
    • Supported SQL and PL data types
    • Common APIs
      • Overview of common APIs
      • 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
  • Release Notes
    • V2.2
      • OceanBase Connector/J V2.2.10
      • OceanBase Connector/J V2.2.0

Download PDF

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

What's New

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

In OceanBase Connector/J V2.2.7, the performance of SEND PIECE, COM_STMT_PREPARE_EXECUTE, and PreparedStatement.setBytes in Oracle mode is enhanced, and the restrictions on Statement FetchSize and the conditions for using useCursorFetch to retrieve the result set are adjusted.

Main feature changes in this version are as follows:

  • In Oracle mode, SEND PIECE is disabled by default. To enable SEND PIECE, you must set useServerPrepStmts=true and usePieceData=true. For more information, see COM_STMT_SEND_PIECE_DATA.

  • In Oracle mode, COM_STMT_PREPARE_EXECUTE supports batch execution. For more information, see COM_STMT_PREPARE_EXECUTE.

  • In Oracle mode, the PreparedStatement.setBytes performance is optimized, and the time consumed for processing 32 KB of data is reduced from 60 ms to 15 ms. For more information, see LOB data interface.

  • The restrictions on Statement FetchSize are adjusted.

    • Statement FetchSize cannot be set to a negative number in Oracle mode. The default value is 10, which is the same as that in the native Oracle Java Database Connectivity (JDBC) driver.

    • In MySQL mode, Statement FetchSize cannot be set to any negative value except that of Integer.MIN_VALUE. The default value is 0, which is the same as that in the native MySQL JDBC driver.

    For more information, see FetchSize.

  • The conditions for using useCursorFetch to retrieve the result set are adjusted.

    • In Oracle mode, when useServerPrepStmts is enabled, regardless of whether useCursorFetch is enabled, a cursor is used to retrieve data for SELECT queries.

    • In MySQL mode, when useServerPrepStmts is enabled, if useCursorFetch is enabled (useServerPrepStmts=true), the result set scroll type is TYPE_FORWARD_ONLY, the result set concurrency type is recur_read_only, and FetchSize is greater than 0, a cursor is used to retrieve data for SELECT queries.

    For more information, see Overview of result sets.

Next topic

Compatibility requirements
Next