spring.datasource.initialSize
5
Init connection number
int
spring.datasource.minIdle
5
Min connection number
int
spring.datasource.maxActive
50
Max connection number
int
spring.datasource.maxWait
60000
Max wait time for get a connection in milliseconds.
If configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases.
If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true.
int
spring.datasource.timeBetweenEvictionRunsMillis
60000
Milliseconds for check to close free connections
int
spring.datasource.timeBetweenConnectErrorMillis
60000
The Destroy thread detects the connection interval and closes the physical connection in milliseconds
if the connection idle time is greater than or equal to minEvictableIdleTimeMillis.
int
spring.datasource.minEvictableIdleTimeMillis
300000
The longest time a connection remains idle without being evicted, in milliseconds
int
spring.datasource.validationQuery
SELECT 1
The SQL used to check whether the connection is valid requires a query statement.
If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work.
spring.datasource.validationQueryTimeout
3
int
Check whether the connection is valid for timeout, in seconds
spring.datasource.testWhileIdle
true
boolean
When applying for a connection,
if it is detected that the connection is idle longer than time Between Eviction Runs Millis,
validation Query is performed to check whether the connection is valid
spring.datasource.testOnBorrow
true
boolean
Execute validation to check if the connection is valid when applying for a connection
spring.datasource.testOnReturn
false
boolean
Execute validation to check if the connection is valid when the connection is returned
spring.datasource.defaultAutoCommit
true
boolean
spring.datasource.keepAlive
false
boolean
spring.datasource.poolPreparedStatements
true
boolean
Open PSCache, specify count PSCache for every connection
spring.datasource.maxPoolPreparedStatementPerConnectionSize
20
int
spring.datasource.spring.datasource.filters
stat,wall,log4j
spring.datasource.connectionProperties
druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000