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.0
  • What is OceanBase Connector J?
    • 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
      • Failover and load balancing modes
      • LoadBalance strategies
      • LoadBalance strategies configuration methods
    • 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
      • Get remarks information
      • 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.4
      • 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.0

Overview of result sets

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

Result sets can be categorized into full result sets, streaming result sets, and cursor result sets by data read method.

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

Result set category
Query method
Data reading method
Advantages
Disadvantages
Full result set Ordinary query All results are read at a time. The application code is simple. When the data volume is small, the result set is read in the fastest speed. 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 the database for a shorter 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 categories in MySQL mode and Oracle mode.

Result set category
MySQL mode
Oracle mode
Cursor result set * The URL connection string is set to &useCursorFetch=true. * The result set type is TYPE_FORWARD_ONLY. * The result set concurrency is recur_read_only. * The value of FetchSize is greater than 0. The URL connection string is set to &useServerPrepStmts=true or &useCursorFetch=true. Note When useCursorFetch is set to true, useServerPrepStmts is 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 None.
Full result set Full result sets are used unless the trigger conditions for cursor result sets or streaming result sets are met. The URL connection string is set to &useServerPrepStmts=false.

Previous topic

Handle SQL exceptions
Last

Next topic

Limits
Next