TOMCAT J2EE项目连接池配置
web 项目的 web.xml
<web-app>
<resource-ref>
<description>DB Connectiondescription>
<res-ref-name>jdbc/oracleres-ref-name>
<res-type>javax.sql.DataSourceres-type>
<res-auth>Containerres-auth>
resource-ref>
web-app>
Eclipse 下下面tomcat server 文件:
Server.xml
<GlobalNamingResources><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>
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"/>