SSH框架整合连接池proxool的配置

1. 添加所需架包:proxool-0.9.jar.

2. 准备属性文件:pool.properties.

 

#pool-proxool
driver=com.mysql.jdbc.Driver
driverUrl=jdbc\:mysql\://127.0.0.1\:3306/StudentDB?user\=root&password\=***&useUnicode\=true&characterEncoding\=utf-8&characterSetResults\=UTF-8
user=root
password=***

alias=proxoolPool
houseKeepingSleepTime=30000
prototypeCount=20
minimumConnectionCount=5
maximumConnectionCount=30
maximumActiveTime=300000
trace=true
verbose=true
houseKeepingTestSql=select CURRENT_DATE
simultaneousBuildThrottle=50

 

3. 修改spring配置文件

 

    <!-- ========================================================= -->
    <!--                   加载属性文件                      -->
    <!-- ========================================================= -->
	<context:property-placeholder location="/WEB-INF/*.properties"/>
	
    <!-- ========================================================= -->
    <!--                  配置  proxool  连接池                  -->
    <!-- ========================================================= -->
	<bean id="dataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource">
		<property name="driver" value="${driver}" />
		<property name="driverUrl" value="${driverUrl}" />
		<property name="user" value="${user}" />
		<property name="password" value="${password}" />
		
		<property name="alias" value="${alias}" />
		<property name="maximumActiveTime" value="${maximumActiveTime}" />
		<property name="prototypeCount" value="${prototypeCount}" />
		<property name="trace" value="${trace}" />
		<property name="verbose" value="${verbose}" />
		<property name="houseKeepingSleepTime" value="${houseKeepingSleepTime}" />
		<property name="maximumConnectionCount" value="${maximumConnectionCount}" />
		<property name="minimumConnectionCount" value="${simultaneousBuildThrottle}" />
		<property name="simultaneousBuildThrottle" value="${simultaneousBuildThrottle}" />
		<property name="houseKeepingTestSql" value="${houseKeepingTestSql}" />
	</bean>

 

 

你可能感兴趣的:(spring,框架,mysql,bean,ssh)