tomcat目录下conf中的
1:context.xml
<Resource name="jdbc/aaa_db" type="javax.sql.DataSource" username="test" password="123456" driverClassName="oracle.jdbc.driver.OracleDriver" maxIdle="3" maxWait="5000" url="jdbc:oracle:thin:@192.168.30.99:1521:orcl" maxActive="10"/>
2.项目中web.xml里面的配置和context.xml实例名一样
<resource-ref> <description>db connect</description> <res-ref-name>jdbc/aaa_db</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>