用户工具

站点工具


dbcp_config

一份经过优化的dbcp配置

懒得解释为什么,想要知道的请直接联系我,哈哈

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">   
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />  
    <property name="url" value="${url}" />  
    <property name="username"><value>${username}</value></property>  
        <property name="password"><value>${password}</value></property>  
        <property name="maxActive"><value>20</value></property>  
        <property name="initialSize"><value>1</value></property>  
        <property name="maxWait"><value>60000</value></property>  
        <property name="maxIdle"><value>20</value></property>  
        <property name="minIdle"><value>3</value></property>  
        <property name="removeAbandoned"><value>true</value></property>  
        <property name="removeAbandonedTimeout"><value>180</value></property>  
        <property name="connectionProperties"><value>clientEncoding=UTF-8</value></property>
        <property name= "validationQuery" value="select 1" />
        <property name="testWhileIdle"><value>true</value></property> 
    	<property name="testOnBorrow"><value>false</value></property>  
    	<property name="testOnReturn"><value>false</value></property>  
    	<property name="validationQueryTimeout"><value>1</value></property>  
    	<property name="timeBetweenEvictionRunsMillis"><value>30000</value></property>  
    	<property name="numTestsPerEvictionRun"><value>20</value></property>
</bean>
dbcp_config.txt · 最后更改: 2018/10/14 15:31 (外部编辑)