50010623 发表于 2017-1-6 09:24:35

org.apache.commons.dbcp.BasicDataSource 设置技巧

     <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"><property name="driverClassName" value="com.mysql.jdbc.Driver"/><property name="url" value="jdbc:mysql://localhost:3306/shopping"/><property name="username" value="hongboliu"/><property name="password" value="a123"/><property name="maxActive" value="10"/><property name="minIdle" value="1"/><property name="maxIdle" value="10"/><property name="initialSize" value="1"/><!-- 设置在自动回收超时连接的时候打印连接的超时错误--><property name="logAbandoned" value="true"/><!-- 设置自动回收超时连接 --><property name="removeAbandoned"value="true"/><!-- 超时时间(以秒数为单位) --><property name="removeAbandonedTimeout" value="10"/><!-- 超时等待时间以毫秒为单位--><property name="maxWait" value="100"/></bean>
页: [1]
查看完整版本: org.apache.commons.dbcp.BasicDataSource 设置技巧