继续问:sql2005数据库连接池问题
我的数据库连接池已经做好了配置:
所以该配置的xml文件如下:
MyWeb.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource
name="jdbc/mysql"
type="javax.sql.DataSource"
maxActive="4"
maxIdle="2"
username="sa"
maxWait="5000"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
password="123456"
url="jdbc:microsoft:sqlserver://localhost/EdocServer_db"/>
</Context>
server.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
name="jdbc/mysql"
type="javax.sql.DataSource"
maxActive="4"
maxIdle="2"
username="sa"
maxWait="5000"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
password="123456"
url="jdbc:microsoft:sqlserver://localhost/EdocServer_db"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="8080"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>&n