tencent cloud

TDSQL Boundless

Connect using a database connection pool

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-03-06 18:48:23
The core value of connection pooling: addressing three critical issues arising from direct connections to TDSQL Boundless—performance overhead from frequent connection creation/destruction, uncontrolled connection growth, and the risk of database avalanche.
TDSQL Boundless is fully compatible with MySQL 8.0 protocols and syntax. All JDBC drivers and database connection pools in the MySQL ecosystem can seamlessly connect to TDSQL Boundless.

Prerequisites

Development Environment Dependencies

Driver dependency: All connection pools connect to TDSQL Boundless using the MySQL JDBC driver. TDSQL Boundless does not require a separate driver package; simply use the official MySQL driver.
JDK version: JDK8 and above (JDK8/JDK11 recommended).

Obtain the Standard Connection Information for TDSQL Boundless

Before connecting to TDSQL Boundless, obtain the following core information:
Information Item
Example
Description
JDBC connection URL
jdbc:mysql://tdsql-xxxxxx.dns.tdsql.com:3306/your_db_name
Fully consistent with MySQL.
Username.
tdsql_user
An account independently assigned by TDSQL Boundless, with strict database and table privileges.
Password
TdSql@Pass123
For production environments, complex passwords are recommended, including uppercase and lowercase letters + special characters.
Driver class name
com.mysql.cj.jdbc.Driver (MySQL8.x driver, recommended)
com.mysql.jdbc.Driver (MySQL5.x driver)
-

Core Specifications: TDSQL Boundless Connection Pool General Configuration Parameters

JDBC URL Connection Parameters

Full URL Example

jdbc:mysql://tdsql-******.dns.tdsql.com:3306/your_db_name?
useUnicode=true&
characterEncoding=utf8mb4&
serverTimezone=Asia/Shanghai&
autoReconnect=true&
failOverReadOnly=false&
rewriteBatchedStatements=true&
connectTimeout=3000&
socketTimeout=60000

Detailed Parameter Description

Parameter
Value
Usage
useUnicode
true
Enable Unicode encoding.
characterEncoding
utf8mb4
Supports full Unicode, including emoji characters, to prevent Chinese garbled text.
serverTimezone
Asia/Shanghai
Set the time zone to UTC+8 to resolve time zone exceptions in the MySQL 8.x driver. This is mandatory for TDSQL Boundless clusters deployed across regions.
autoReconnect
true
TDSQL Boundless is a master-slave architecture + high-availability failover. When connection is disconnected / master database switches, it automatically reconnects with write access restored upon reconnection, preventing business errors caused by invalid connections.
failOverReadOnly
false
rewriteBatchedStatements
true
Enable batch SQL rewriting to improve the performance of INSERT/UPDATE batch operations.
connectTimeout
3000
Set the connection establishment timeout to 3 seconds for fast failure, avoiding thread blocking.
socketTimeout
60000
Set the read/write timeout to 60 seconds to prevent connection pool exhaustion caused by slow SQL.

Core Parameters of Connection Pool

Parameter Category
HikariCP Parameters
Druid Parameters
Recommended Value
Description
Connection Pool Size (Minimum Idle Connections)
minimumIdle
minIdle
CPU cores × 2
Defaulting to 5 is sufficient to ensure a fixed number of idle connections in the connection pool, avoiding frequent connection creation.
Maximum Number of Connections
maximumPoolSize
maxActive
Configure as needed.
-
Idle Connection Reclaim Time
idleTimeout
maxEvictableIdleTimeMillis
300000ms (5 minutes)
Reclaim long-idle connections to release database resources.
Connection Wait Timeout (ms)
connectionTimeout
maxWait
3000ms (3 seconds)
When no connections are available in the connection pool, this setting defines the timeout period for business threads to wait, enabling fast failure to prevent thread blocking and accumulation.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック