首先配置c3p0连接池,把c3p0-0.9.2.1.jar和ojdbc.jar都拷贝到 eclipse,并且在webproject工程下src下面创建一个c3p0.properties文件,文件内书写如下:
c3p0.jdbcUrl=jdbc:oracle:thin:@localhost:1521:orcl
c3p0.driverClass=oracle.jdbc.driver.OracleDriver
c3p0.user=bbs
c3p0.password=123
c3p0.acquireIncrement=3
c3p0.idleConnectionTestPeriod=60
c3p0.initialPoolSize=10
c3p0.maxIdleTime=60
c3p0.maxPoolSize=20
c3p0.maxStatements=100
c3p0.minPoolSize=5