JDBC配置文档 | 数据库 | 文档链接 | ssl配置文档 | 
| Postgres | Initializing the Driver | pgJDBC | Initializing the Driver | pgJDBC | 
| MySQL | MySQL :: MySQL Connector/J Developer Guide | MySQL :: MySQL Connector/J Developer Guide :: 6.3 Configuration Properties | 
 
 
 java数据库连接池配置文档 | 连接池 | 文档链接 | ssl配置 | 最佳实践必配参数 | 示例 | 
| druid | Configuration reference | Apache® Druid https://github.com/alibaba/druid/wiki/ druid/druid-spring-boot-starter at master · alibaba/druid · GitHub | Configuration reference | Apache® Druid | initial-size: 连接池初始化时创建的连接数量。min-idle: 连接池中最小的空闲连接数。max-active: 连接池中最大的活动连接数。max-wait: 在获取连接时的最大等待时间,单位毫秒。如果超过这个时间仍无法获取连接,将会抛出异常。time-between-eviction-runs-millis: 连接有效性检查的执行频率,单位毫秒。如果配置了连接有效性检查,这个参数定义了检查的间隔。min-evictable-idle-time-millis: 一个连接在被驱逐前至少需要空闲的时间,单位毫秒。这有助于清理长期未使用的连接。validation-query: 用于测试连接有效性的 SQL 查询语句。test-while-idle: 是否在空闲时测试连接的有效性。test-on-borrow: 是否在从连接池获取连接前进行有效性测试。test-on-return: 是否在连接返回到连接池时进行有效性测试。pool-prepared-statements: 是否开启 PreparedStatement 缓存。max-pool-prepared-statement-per-connection-size: 每个连接缓存的 PreparedStatement 的最大数量。
 | spring:datasource:type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/your_databaseusername: your_usernamepassword: your_passworddruid:initial-size: 5min-idle: 5max-active: 20max-wait: 60000time-between-eviction-runs-millis: 60000min-evictable-idle-time-millis: 300000validation-query: SELECT 1test-while-idle: truetest-on-borrow: falsetest-on-return: falsepool-prepared-statements: truemax-pool-prepared-statement-per-connection-size: 20
 | 
| HikariCP | GitHub - brettwooldridge/HikariCP: 光 HikariCP・A solid, high-performance, JDBC connection pool at last. |  |  |  | 
| DBCP | DBCP – BasicDataSource Configuration |  |  |  | 
 
 
注意:jdbc的很多配置会被数据库连接池的配置所覆盖,所以使用了连接池之后,建议以连接池的配置为第一优先级