日期:2014-05-16  浏览次数:20465 次

tomcat 6 数据库连接池配置

??????? 前几天,在客户现场,DWR报了“无法获得连接”的错误,回来后在tomcat上配了数据库连接池。记录一下配置的步骤,备用!

??????? 一 在apache-tomcat-6.0.14\conf\context.xmlContext标签内增内以下内容:

??????

???????Context标签内增内以下内容:

??????

????????

????????????? <Resource name="jdbc/aaa"

?????????????????????? ?auth="Container"

????????????????????????type="javax.sql.DataSource"

?????????????????????? password="123"?

???????????????????????username="sa"

?????????????????????? driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"

?????????????????????? url="jdbc:sqlserver://192.168.0.26:1433;databaseName=dbs"

?????????????????????? maxActive="130"?

????????????????????? ?maxIdle="30"???

?????????????????????? maxWait="5000"

?????????????????????? testOnBorrow="true"

?????????????????????? testOnReturn="true"

?????????????????????? testWhileIdle="true"

?????????????????????? validationQuery="select 1"

?????????????????????? removeAbandoned="true"?? <