1 ?应用的web.xml
?
<resource-ref> <res-ref-name>jdbc/DataSource1</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> <resource-ref> <res-ref-name>jdbc/DataSource2</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
?2 把需要的JAR包放入 tomcat的LIB下面,6.0在HOME下面直接有一个LIB目录,5.5在common下面有LIB目录
?
?3修改content.xml,添加JNDI配置部分
?
?<Resource name="jdbc/DataSource1"?
auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@192.168.56.10:1521:orcl10g" username="testbrook" password="testbrook" maxActive="100" maxIdle="30" maxWait="10000" /> <Resource name="jdbc/DataSource2" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@192.168.56.1:1521:orcl10g" username="testbrook" password="testbrook" maxActive="100" maxIdle="30" maxWait="10000" />
?
4把WAR包放入TOMCAT的webapps里面,重启TOMCAT
?