把驱动包拷到common/lib里,很重要
在Tomcat安装目录下 conf/Catalina/发布工程名.xml中
- <?xml version="1.0" encoding="UTF-8"?>
- <Context>
- <Resource name="jdbc/logis" auth="Container"
- type="javax.sql.DataSource"
- maxActive="100"
- maxWait="10000"
- maxIdle="30"
- username="scott"
- password="csusoft"
- driverClassName="oracle.jdbc.driver.OracleDriver"
- url="jdbc:oracle:thin:@localhost:1521:ORCL"
- />
- </Context>
maxActive 最大的活动连接数
maxldle 最大的空闲连接数
maxWait 最大的等待连接数
在web.xml中添加
- <resource-ref>
- <res-ref-name>jdbc/logis</res-ref-name>
- <res-type>java.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- </resource-ref>