日期:2014-05-16  浏览次数:20432 次

dbcp配置选项


?

testOnBorrow默认为true, 要设置为false. ?若设置validationQuery则对性能影响比较大.

testWhileIdle默认为false,设置为true.并设置validationQuery

maxIdle最好设置为与maxActive一样。

initialSize与minIdle按业务要求配置,一般都要配置。

timeBetweenEvictionRunsMillis默认为-1.设置一定数值300000

numTestsPerEvictionRun默认是3, 这个值要调大点maxActive的一半较好。?

?

以下apache dbcp的配置项

?

Parameters


Parameter Description
username The connection username to be passed to our JDBC driver to establish a connection.
password The connection password to be passed to our JDBC driver to establish a connection.
url The connection URL to be passed to our JDBC driver to establish a connection.
driverClassName The fully qualified Java class name of the JDBC driver to be used.
connectionProperties The connection properties that will be sent to our JDBC driver when establishing new connections.?
Format of the string must be [propertyName=property;]*?
NOTE?- The "user" and "password" properties will be passed explicitly, so they do not need to