DruidDataSource大部分属性都是参考DBCP的,如果你原来就是使用DBCP,迁移是十分方便的。
参考配置
<bean id= "dataSource" class = "com.alibaba.druid.pool.DruidDataSource" init-method= "init" destroy-method= "close" > <property name= "url" value= "${jdbc_url}" /> <property name= "username" value= "${jdbc_user}" /> <property name= "password" value= "${jdbc_password}" /> <property name= "filters" value= "stat" /> <property name= "maxActive" value= "20" /> <property name= "initialSize" value= "1" /> <property name= "maxWait" value= "60000" /> <property name= "minIdle" value= "1" /> <property name= "timeBetweenEvictionRunsMillis" value= "3000" /> <property name= "minEvictableIdleTimeMillis" value= "300000" /> <property name= "validationQuery" value= "SELECT 'x'" /> <property name= "testWhileIdle" value= "true" /> <property name= "testOnBorrow" value= "false" /> <property name= "testOnReturn" value= "false" /> <property name= "poolPreparedStatements" value= "true" /> <property name= "maxPoolPreparedStatementPerConnectionSize" value= "20" /> </bean> |
在上面的配置中,通常你需要配置url、username、password,maxActive这三项。
测试与 quartz-all-2.1.6.jar 有冲突。。。
有待完善。。。