Software: (1) Tomcat5.0
http://apache.linux process.net/dist/j...mcat-5.0.25.exe
(2) jtds.jar
http://jtds.sourceforge.net/
(3) JDK1.4 (4) SQLServer2000 (Windows2003 system requires SP3 patch) Set environment variables: (1) Catalina_home Tomcat installation path, such as: E: /TOMCAT5.0 (2) Cataalina_base Tomcat installation path, such as: E: E : / Tomcat5.0 (3) Java_Home JDK Installation Path, such as: E: / Program Files / J2SDK1.4.2 (4) Path% Java_Home% / BIN (5) Class_Path.;% Java_Home% / lib / dt.jar;% Java_Home% / lib / Tools.jar;% catalina_home% / common / lib / servlet-api.jar (front. And; can not be less) to put jtds.jar in the correct directory can only be placed at% CATALINA_HOME% / Common / Modify the server.xml file in the lib / directory in:;% CATALINA_HOME% / conf / server.xml in
Between, the modified content is: "E: / tiannet" debug = "5" reloadable = "true" crosscontext = "true" > "org.apache.catalina.logger.filelogger" Directory = "logs" prefix = "localhost_log." SUFFIX = ".txt" TimeStamp = "True" /> "JDBC / ConnectDB" Auth = "Container" type = "javax.sql.datasource" /> > > > > Parameter > > > > > > > Parameter > > > > Parameter > > > > Parameter > > > > Parameter > > > > Parameter > > > > Parameter > > > > Parameter > > > > Parameter > > > //127.0.0.1:1433/tiannet; character cNET ;Charset=GB2312 value> parameter > Resourceparams > Context> Parameter Description 1) Path Specifies the path, which is to access the web, here http: // localhost: 8080 / Tiannet 2) The path of the DOCBase virtual directory, absolute path. If the virtual directory sets the% catalina_home% / webapps directory (such as tiannet), you can write the subdirectory name (such as tiannet). 3) RELOADER is recompiled when the web is updated. 4) The maximum number of database connections for the MaxActive connection pool. Set to 0 means unlimited. 5) The maximum idle time for the MaxIdle database connection. More than this idle time, the database connection will be marked as unavailable and then released. Set to 0 means unlimited. 6) MaxWait builds a maximum connection wait time. If you exceed this time will receive an exception. Set to -1 means unlimited. 7) Removeabandoned recycles abandoned (generally forgotting the release) database connection to the connection pool. 8) RemoveabandONEDTIMEOUT Database Connections After the connection is not considered to be abandoned and the connection pool is retracted. 9) logabandoned will be recorded in the logged database. 10) DriverclassName JDBC driver. 11) Username: Username 12) Password: Password: Connect Database 13) URL Format Database Connection String (Tiannet here), format: JDBC: JTDS: Modify the /Web-inf/web.xml file Create a web-inflicate under the root of the virtual directory (here: E: / Tiannet), create a web.xml file in the web-inflicity, the basic content is: < XML Version = "1.0" encoding = "ISO-8859-1"> Test connection pool code <% @ Page ContentType = "text / html; charset = GB2312"%> <% @ page import = "java.sql. *"%> <% @ Page import = "javax.sql. *" %> <% @ page import = "javax.naming. *"%>