1. 将Oracle bin下面D:/oracle/product/10.2.0/db_1/jdbc/lib的class12.jar 放入Tomcat bin下面
2.META-INF下建一个context.xml
<context>
<Resource name = "jdbc/crm" auth = "Container"
type = "javax.sql.DataSource"
maxActive = "50"
maxIdle = "30"
maxWait = "10000"
logAbandoned = "true"
username = "Michael"
password = "ty123"
driverClassName = "oracle.jdbc.driver.OracleDriver"
url = "jdbc:oracle:thin:@localhost:1521:Orcl"/>
</context>
3.然后在WEB-INF下的web.xml中加入
<resource-ref>
<description>crm</description>
<res-ref-name>jdbc/crm</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>