首页 > 代码库 > web 连接池配置
web 连接池配置
TOMCAT J2EE项目连接池配置
web 项目的 web.xml
<web-app>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
Eclipse 下下面tomcat server 文件:
Web.xml
<web-app>
<resource-ref>
<description>
DB Connection
</description>
<res-ref-name>
jdbc/oracle
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>
</web-app>
Server.xml
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
<Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="50" maxWait="5000" maxldle="10" name="jdbc/oracle" password="titi123love" type="javax.sql.DataSource" url="jdbc:oracle:thin:@127.0.0.1:1521:xe" username="titi"/>
</GlobalNamingResources>
<Context docBase="D:/Program Files/DEV/Tomcat6/webapps/transfer" path="">
<ResourceLink global="jdbc/oracle" name="jdbc/oracle" type="javax.sql.DataSource"/>
</Context>
Content.xml
<Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="50" maxWait="5000" maxldle="10" name="jdbc/oracle" password="titi123love" type="javax.sql.DataSource" url="jdbc:oracle:thin:@127.0.0.1:1521:xe" username="titi"/>
web 连接池配置