Based on the data source database connection pool configuration Druid

 

Based on the data source database connection pool configuration Druid

<! - based data sources Druid pool configuration database link ->
<the bean ID = "the dataSource" class = "com.alibaba.druid.pool.DruidDataSource" = the init-Method "the init" the destroy-Method = "Close" >
<! - the basic properties driverClassName, URL, User, password ->
<property name = "driverClassName" value = "com.mysql.jdbc.Driver" />
<property name = "URL" value = "$ {JDBC } .url "/>
<Property name =" username "value =" $ {jdbc.username} "/>
<Property name =" password "value =" $ {jdbc.password} "/>
<-! configuration initialization size, minimum, maximum ->
<! - In general, only need to modify initialSize, minIdle, for maxActive ->
<Property name = "initialSize" value = "2" />
<property name="minIdle" value="2" />
<property name="maxActive" value="30" />
<property name="testWhileIdle" value="false" />

<! - configuration acquisition time waiting for the timeout of the connection ->
<Property name = "maxWait" value = "5000" />
<! - setting up a connection in a minimum time of survival in the pool, in milliseconds ->
< name = Property "minEvictableIdleTimeMillis" value = "30000" />
<-! intervals the frequency of such detection, an idle connection is detected to be closed, in milliseconds ->
<Property name = "timeBetweenEvictionRunsMillis" value = "60000" />
<-! decryption password must be configured items ->
<Property name = "Filters" value = "config" />
<Property name = "ConnectionProperties" value = "config.decrypt = to true" />
</ bean>

Guess you like

Origin www.cnblogs.com/chenglaoshi/p/11563242.html