tomcat部署oracle数据库

来源:互联网 发布:博客庄家统计软件 编辑:程序博客网 时间:2024/06/07 16:02

tomcat是6.0.18,oracle是远程连接的

1.将ojdbc6.jar放入apache-tomcat-6.0.18\bin中

2.编辑:apache-tomcat-6.0.18\conf\context.xml

<Context path="/reserve" >//reserve:项目名称

<Resource  name="jdbc/reserveDataSource"   auth="Container"  type="javax.sql.DataSource"//reserveDataSource:数据库源名称
            factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
            maxActive="200"
            maxIdle="50"
            maxWait="3000"
            username="test"//数据库用户名
            password="test"//密码
            driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521:PRODORCL"/> //远程url
</Context>

3.新建:E:\apache-tomcat-6.0.18\conf\catalina\localhost\reserve.xml       //reserve:项目名称

<?xml version='1.0' encoding='utf-8'?>
<Resource  name="reserveDataSource"   auth="Container"  type="javax.sql.DataSource"
 factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
maxActive="200"
maxIdle="50"
maxWait="3000"
username="test"
password="test"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:PRODORCL"/>


0 0
原创粉丝点击