pom.xml
xsi:schemaLocation="
4.0.0
com.java
Dao
0.0.1-SNAPSHOT
war
org.apache.maven.plugins
maven-compiler-plugin
1.6
1.6
UTF-8
org.springframework
spring-context
3.2.12.RELEASE
org.springframework
spring-tx
3.2.12.RELEASE
org.springframework
spring-test
3.2.12.RELEASE
org.springframework
spring-orm
3.2.12.RELEASE
junit
junit
4.12
org.springframework
spring-expression
3.2.12.RELEASE
org.springframework
spring-webmvc
3.2.12.RELEASE
org.hibernate
hibernate-core
4.1.12.Final
commons-dbcp
commons-dbcp
1.4
com.oracle
ojdbc5
11.1.0.0
org.aspectj
aspectjrt
1.8.0
org.aspectj
aspectjweaver
1.8.0
C0P3配置:
destroy-method="close"
p:driverClass="com.mysql.jdbc.Driver"
p:jdbcUrl="jdbc:mysql://localhost:3306/YTOAttendManageSystem"
p:user="root"
p:password="1234"
p:maxPoolSize="40"
p:minPoolSize="1"
p:initialPoolSize="1"
p:maxIdleTime="20"/>
至于如何将c3p0的具体配置参数放到properties文件里,以C0P3为例:
destroy-method="close"
p:driverClass="${driverClass}"
p:jdbcUrl="${jdbcUrl}"
p:user="${user}"
p:password="${password}"
p:maxPoolSize="${maxPoolSize}"
p:minPoolSize="${minPoolSize}"
p:initialPoolSize="${initialPoolSize}"
p:maxIdleTime="${maxIdleTime}"/>
建一个properties文件:
driverClass=com.mysql.jdbc.Driver
jdbcUrl=jdbc:mysql://localhost:3306/YTOAttendManageSystem
…………