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

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

Overview of result sets

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

Result sets can be categorized into three types: full result sets, streaming result sets, and cursor result sets, based on the data reading method.

The following table describes the three result set types, including their advantages and disadvantages.

Result set type
Query method
Data reading method
Advantage
Disadvantage
Full result set General query All results are read at a time. The application code is simple. When the data volume is small, result sets of this type are read faster than those of the other two types. The out-of-memory (OOM) error will be reported when the data volume is large.
Streaming result set Streaming query Data is read from the socket row by row rather than all at a time. The OOM error will not occur even when the data volume is large. The execution occupies the database for a longer time and cannot be stopped once it starts. Therefore, it may cause network congestion.
Cursor result set Cursor query Multiple rows of data are read at a time. All results are obtained through multiple reads. The OOM error will not occur even when the data volume is large. Compared with a streaming query, a single cursor query occupies a shorter DB time. The execution is relatively slow. Compared with a streaming query, a cursor query consumes more server resources with a longer response time.

Note

When the text protocol is executed, full result sets are used in OceanBase Database no matter in Oracle mode or MySQL mode.

The following table lists the trigger conditions of the three result set types in MySQL mode and Oracle mode.

Result set type
MySQL mode
Oracle mode
Cursor result set
  • The &useCursorFetch=true property is configured in the URL connection string.
  • The result set type is TYPE_FORWARD_ONLY.
  • The result set concurrency is CONCUR_READ_ONLY.
  • The value of FetchSize is greater than 0.
The &useServerPrepStmts=true or &useCursorFetch=true property is configured in the URL connection string.
Note: When useCursorFetch is set to true, useServerPrepStmts will be automatically set to true.
Streaming result set
  • The result set type is TYPE_FORWARD_ONLY.
  • The result set concurrency is CONCUR_READ_ONLY.
  • The value of FetchSize is the same as that of Integer.MIN_VALUE.
Not supported.
Note: Streaming read is no longer supported in OceanBase Connector/J V2.2.7 or later in Oracle mode.
Full result set Full result sets are used unless the trigger conditions for cursor result sets or streaming result sets are met. The &useServerPrepStmts=false property is configured in the URL connection string.

Previous topic

Handle SQL exceptions
Last

Next topic

Limitations
Next