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) | - |
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
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 nodes automatically trigger high availability switching during events such as rolling upgrades, configuration changes, or outages, which results in connection disconnections. It is recommended that clients enable automatic reconnection to avoid business errors caused by connection failures. |
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. |
Parameter Category | HikariCP Parameters | Druid Parameters | Recommended Value | Description |
Connection Pool Size (Minimum Idle Connections) | minimumIdle | minIdle | Number of 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. |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan