<!--data source 1--<bean id= "DataSource"class= "Org.apache.commons.dbcp.BasicDataSource"Destroy-method= "Close" > <property name= "driverclassname" value= "Com.mysql.jdbc.Driver"/> <property name = "url" value= "Jdbc:mysql://192.168.0.109:3306/test?useunicode=true&characterencoding=utf-8"/> < Property name= "username" value= "root"/> <property name= "password" value= "root"/> <!--maxactive: Maximum number of connections-<property name= "maxactive" value= "/> <!--minidle: Minimum idle connection--<prop Erty name= "Minidle" value= "5"/> <!--maxidle: Maximum idle connection--<property name= "Maxidle" value= "/>" ; <!--initialsize: Initialize Connect--<property name= "initialsize" value= "" "/> < Whether the connection is printed when!--is compromised <property name= "logabandoned" value= "true"/> <!--removeabandoned: Auto Recycle timeout connection--<pro Perty name= "removeabandoned" value= "true"/> <!--removeabandonedtimeout: Time-out (in seconds)--<prop Erty name= "RemoveabandoneDtimeout "value="/> <!--maxwait: Timeout wait time in milliseconds 1000 equals 60 seconds--<property name= "maxwait" value= "10 /> <!--The time value, in milliseconds, that sleeps during the idle connection collector thread run. --<property name= "Timebetweenevictionrunsmillis" value= "10000"/> <!--checked at each idle connection collector thread (if any) run-time Number of connections-<property name= "Numtestsperevictionrun" value= "ten"/> <!--1000 * 60 * 30 connections remain idle in the pool without being empty Idle connection Collector Thread--<property name= "Minevictableidletimemillis" value= "10000"/> <property name= "ValidationQu ery "value=" Select Now () from DUAL "/> </bean>
Reference Path: http://blog.csdn.net/fairyhawk/article/details/7565391
Configuration of the DBCP connection pool