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

C3P0配置(原创)
server.xml:
<Resource
maxActive="50"
maxIdle="50"
minIdle="50"
initialSize="50"
maxWait="15"
maxPoolSize="50"
minPoolSize="4"
type="javax.sql.DataSource"
name="jdbc/connPool"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://192.168.1.1:3306/数据库名"
username="mysql用户名"
password="mysql用户名口令"/>




context.xml:
<ResourceLink
type="javax.sql.DataSource"
name="jdbc/localConnPool"
global="jdbc/connPool"/>



web.xml;
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/connPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>