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/ODBC

V2.0.9
  • Overview
  • Driver installation and configuration
    • Prepare for the installation
    • Install and configure the ODBC driver for Linux
    • Install and configure OceanBase Connector/ODBC for Windows
  • User guide
    • Basic operations
    • Enable logging
    • Get REF CURSOR data type
    • Scalar function escape
    • Call Function
  • Reference information
    • API functions in OceanBase Connector/ODBC
    • Data types in OceanBase Connector/ODBC
    • Error codes in OceanBase Connector/ODBC
  • FAQ
    • Query timeout
    • Chinese garbled characters
    • Common OceanBase ODBC installation and configuration issues and solutions
  • 600.version-release-records
    • 9900.V2.0
      • OceanBase Connector/ODBC V2.0.9
      • OceanBase Connector/ODBC V2.0.8
      • OceanBase Connector/ODBC V2.0.7
      • OceanBase Connector/ODBC V2.0.6

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Connector/ODBC
  3. V2.0.9

Query timeout

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

What should I do if the time for connection exceeds 20s and a server disconnection error is returned when I execute the SELECT SLEEP(21) FROM DUAL statement?

What should I do if the time for connection exceeds 20s and a server disconnection error is returned when I execute the SELECT SLEEP(21) FROM DUAL statement?

To solve this problem, specify the READTIMEOUT parameter in the odbc.ini configuration file. In this way, a socket connection is automatically closed when a read operation in the connection times out, and the client is automatically disconnected from the server to avoid long-time waiting.

# Configure the odbc.ini configuration file.
[OBDSN]
Driver     = OBDRIVER
Description = OceanBase Driver DSN
SERVER      = xxx.xxx.xxx.xxx (the IP address of the database)
PORT        = 38884 (the port number of the database)
USER        = tester@oracle (the username that you use to log on to the database)
Password    = 1****** (the password that you use to log on to the database)
Database    = oceanbase (the name of the database)
OPTION      = 4
charset  = UTF8 (the character set of the database)
READTIMEOUT= 20

If READTIMEOUT=20 and ob_query_timeout=10000000 (10s) are specified at the same time, the SELECT SLEEP(15) FROM DUAL statement returns TIMEOUT. The ob_query_timeout parameter specifies the execution timeout period on the server. When the execution on the server exceeds this timeout period, the server automatically sends an error message to the client to avoid long-time waiting of the client.

Previous topic

Error codes in OceanBase Connector/ODBC
Last

Next topic

Chinese garbled characters
Next
on this page
What should I do if the time for connection exceeds 20s and a server disconnection error is returned when I execute the SELECT SLEEP(21) FROM DUAL statement?