Tomcat6.0连接池配置
1.配置tomcat下的conf下的context.xml文件,在之间添加连接池配置:
查看复制到剪切板打印
<Resource name="jdbc/oracle"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url=" jdbc:oracle:thin:@host:port:databse"
username=" user "
password="password"
maxActive="100"
maxIdle="30"
maxWait="10000" />
<Resource name="jdbc/oracle"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url=" jdbc:oracle:thin:@host:port:databse"
username=" user "
password="password"
maxActive="100"
maxIdle="30"
maxWait="10000" /> 2.配置你的应用下的web.xml中的之间加入:
查看复制到剪切板打印
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref> 3.把连接数据库的第三方驱动放到common/lib下面就ok了
4.测试程序我就不写了
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zhengguangyi130/archive/2009/03/02/3950105.aspx