1)在tomcat或许项目中引进最新版的C3P0的JAR包(我是用的是c3p0-0.9.2.1.jar)
假如发动时报类没有找到:Caused by: java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector,
则需求参加mchange-commons-java-0.2.3.4.jar。
2)修改tomcat中的数据源装备,如下:
- <Resource name="jdbc/dbsource"
- type="com.mchange.v2.c3p0.ComboPooledDataSource"
- maxPoolSize="50" minPoolSize="5" acquireIncrement="2" initialPoolSize="10" maxIdleTime="60"
- factory="org.apache.naming.factory.BeanFactory"
- user="xxxx" password="xxxx"
- driverClass="oracle.jdbc.driver.OracleDriver"
- jdbcUrl="jdbc:oracle:thin:@192.168.x.x:1521:orcl"
- idleConnectionTestPeriod="10" />