OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Connector/J

V2.4.1

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Connector/J
    3. V2.4.1
    iconOceanBase Connector/J
    V 2.4.1
    • V 2.4.17
    • V 2.4.16
    • V 2.4.15
    • V 2.4.14
    • V 2.4.5
    • V 2.4.4
    • V 2.4.3
    • V 2.4.2
    • V 2.4.1
    • V 2.4.0
    • V 2.2.11
    • V 2.2.10
    • V 2.2.7
    • V 2.2.6
    • V 2.2.3
    • V 2.2.0

    Overview of result sets

    Last Updated:2026-04-09 07:21:36  Updated
    share
    What is on this page
    share

    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