In fact, there are many things on the internet about this content, the method is very many, I also dare not swim.
Just write about yourself in the course of the online data configuration process of some ideas.
One: Modify the Server.xml file
Tomcat-6.0\conf folder The following code is added to the last in the server.xml file below:
<context path= "/" docbase= "" debug= "5" reloadable= "true" corsscontext= "true" >
<resource name= "Jdbc/connectionpool"
Auth= "Container"
Type= "Javax.sql.DataSource"
Maxactive= "20"
Maxidle= "5"
Maxwait= "10000"
Username= ""
Password= ""
Driverclassname= "Com.microsoft.sqlserver.jdbc.SQLServerdriver"
Url= "Jdbc:sqlserver://localhost:1433;databasedame="/>
The statements that load the driver and URL paths in SQL Server 2000 are
string drivername = "Com.microsoft.jdbc.sqlserver.SQLServerDriver";
string dburl = "jdbc:microsoft:sqlserver://localhost:1433; Databasename=sample ";
Span style= "font-size:16px" >string drivername = "Com.microsoft.sqlserver.jdbc.SQLServerDriver";
string dburl = "jdbc:sqlserver://localhost:1433; Databasename=sample ";
Note 2000 Different from 20,052: one is the sqlserver.jdbc order, the other is less Microsoft's missing < Span style= "font-size:16px" >
Two. Open the Web. xml file under Project file Web-inf (note the file for the project, not the Tomcat file )
Add the following code:
<resource-ref>
<description>Sqlserver2005</description>
<res-ref-name>jdbc/sqlserver2005</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Three. Sqljdbc4.jar the SQL Server2008jdbc drive copy to the Lib in the project file Web-inf
If the version is 2000, three jar packages are imported: Msbase,mssqlserver,msutil.
If the version is 2005, that's Sqljdbc the package.
Some ideas about configuring connection pooling for sqlserve2000 and sqlserver2005 versions