tomcat5配置数据源

在D:\apache-tomcat\tomcat-5.0.28\conf\Catalina\localhost
新建new.xml

<Context debug="0" docBase="E:\work\works\pne\pne\WebRoot" path="/pne" reloadable="true" URIEncoding="GBK">
<Resource name="jdbc/pne" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/pne">
<parameter><name>username</name><value>scott</value></parameter>
<parameter><name>password</name><value>tiger</value></parameter>
<parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
<parameter><name>url</name><value>jdbc:oracle:thin:@127.0.0.1:1521:orcl</value></parameter>
</ResourceParams>
</Context>

web.xml中
<resource-ref>
<description>PNE DB Connection</description>
<res-ref-name>jdbc/pne</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
  </resource-ref>

你可能感兴趣的:(jdbc)