Finally solved the problem of the connection pool for many days, write down this article to share with you. I am configured under the tomcat5.5.9, tomcat5.5.x and previous versions have some differences, so the configuration is also different. I'll just say the basic steps in tomcat5.5.9 configuration: (Make sure you install tomcat5.5.9, sql2000)
1. Copy database JDBC driver to%tomcat_home%/common/lib and%tomcat_home%/webapps/yourweb/web-inf/lib (my WEB folder name is QuickStart)
This step is known to all, otherwise Tomcat cannot connect to the database.
2, modify%tomcat_home%/conf/server.xml file, add the following content between <GlobalNamingResources></GlobalNamingResources>:
<Resource
name="jdbc/quickstart"
type="javax.sql.DataSource"
passWord="123456"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
maxIdle="2"
maxWait="5000"
username="sa"
url="jdbc:microsoft:sqlserver://localhost;DatabaseName=quickstart" maxActive="4"/>
The above content according to everyone's specific situation to modify accordingly, for example: Name= "Jdbc/quickstart" in the QuickStart to and your Web folder name, the password= "123456" in the "123456" to your database password.
3. Create a new XML file with the same name as your Web folder under%tomcat_home%/conf/catalina/localhost (Mine is quickstart.xml)
This step is very important, if you do not have this step will be wrong, will appear org.apache.tomcat.dbcp.dbcp.SQLNestedException:Cannot create JDBC driver of class ' for connect URL ' null '
Such an error, add the 2nd step in the file, as follows:
<?xml version="1.0" encoding="UTF-8"?><Context>
<Resource
name="jdbc/quickstart"
type="javax.sql.DataSource"
password="123456"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
maxIdle="2"
maxWait="5000"
username="sa"
url="jdbc:microsoft:sqlserver://localhost;DatabaseName=quickstart"
maxActive="4"/> </Context>
According to the specific circumstances of the individual change accordingly.