DBCP 연결 풀 설정 상세 설명, 매개 변수 목록

Spring DBCP 설정

     
     
     
     
  1. <bean id=“dataSource” class=“org.apache.commons.dbcp.BasicDataSource” destroy-method=“close”>
  2. <property name=“driverClassName” value=“com.mysql.jdbc.Driver”/>
  3. <property name=“url” value=“jdbc:mysql://192.168.0.109:3306/test?useUnicode=true&characterEncoding=UTF-8”/>
  4. <property name=“username” value=“root”/>
  5. <property name=“password” value=“root”/>
  6. <property name=“initialSize” value=“5”/>
  7. <property name=“maxIdle” value=“10”/>
  8. <property name=“minIdle” value=“5”/>
  9. <property name=“maxActive” value=“15”/>
  10. <property name=“removeAbandoned” value=“true”/>
  11. <property name=“removeAbandonedTimeout” value=“180”/>
  12. <property name=“maxWait” value=“3000”/>
  13. <property name=“timeBetweenEvictionRunsMillis” value=“10000”/>
  14. <property name=“numTestsPerEvictionRun” value=“10”/>
  15. <property name=“minEvictableIdleTimeMillis” value=“10000”/>
  16. <property name=“validationQuery” value=“select 1” />
  17. <property name=“testOnBorrow” value=“true”/>
  18. bean>


username  


password  

url

url

driverClassName 


connectionProperties  

 [propertyName=property;]*

JDBC

defaultAutoCommit

true

true、false

defaultReadOnly

driver default

driver default
true
false

defaultTransactionIsolation 

driver default

ONE
READ_COMMITTED
READ_UNCOMMITTED
REPEATABLE_READ
SERIALIZABLE


ONE

READ_COMMITTED

READ_UNCOMMITTED

REPEATABLE_READ

SERIALIZABLE

defaultCatalog

database , url

initialSize

0

maxActive

8

maxIdle

8

minIdle

0

maxWait

: ,
( ),-1

validationQuery

testOnCreate

false

true、false

create
validationQuery

testOnBorrow

true

true、false

get
validationQuery

testOnReturn

false


validationQuery

testWhileIdle

false


validationQuery

timeBetweenEvictionRunsMillis

-1

, ,-1

numTestsPerEvictionRun

3

( )

minEvictableIdleTimeMillis

1000 * 60 * 30

poolPreparedStatements

false

prepared statement

maxOpenPreparedStatements

statement
statements

( :poolPreparedStatements=true)

accessToUnderlyingConnectionAllowed

false

true、false

Connection( )
:
Connection conn = ds.getConnection();
Connection dconn = ((DelegatingConnection) conn).getInnermostDelegate();

removeAbandoned

removeAbandonedTimeout

logAbandoned


            

좋은 웹페이지 즐겨찾기