Tomcat5 connection pool configuration

xiaoxiao2021-03-06  44

My configuration and running environment is based on Tomcat5.0.28 JDBC3.0 SQLServer2000 JDK1.5, first of all the data drives on the web-inf / lib directory of the web application. First, pay attention to the following aspects: First: Tomcat version problem, I started to pursue a new version, I have a Tomcat5.5.7, I have done N days, I can't live, I don't know if the version has bugs, or when it is configured I didn't match it. Helpless a Tomcat5.0.28, a rough one, OK, success. Second: When the page page is browsing, the error is not available to find Driver, allowing the database to drive the database in the% Tomcat% / CommON / lib directory for Tomcat.

Second, the configuration file, the new% Tomcat% / conf / catalina / localhost sessiontest.xml file factory org.apache.commons.dbcp.basicdataasourcefactory maxactive 100 maxidle 30 maxwait -1 Username sa password 123 < Name> DriverclassName <

Value> com.microsoft.jdbc.sqlserver.sqlserverdriver URL JDBC: Microsoft: SQLServer: // localhost: 1433; DatabaseName = Test Web.xml file under Web.xml file under Web.xml file Index.html Index.htm Index.jsp DB Connection jdbc / sessiontestdb javax.sql.datasource container 3, test page: <% @ page contenttype = "text / html; charset = GBK"%> <% @ Page Import = "java.sql. *"%> <% @ Page Import = "javax.sql. *"%> <% @ page import = "javax.naming. *"%> <% @ page session = "false"%> <% Datasour CE DS = NULL; try {initialcontext (); ds = (DataSource) CTX.lookup ("java: comp / env / jdbc / sessiontestdb"); connectiontestDB "); connection CONN = DS.GetConnection (); statement stmt = conn .createstatement (); string strsql = "select * from jnditest"; ResultSet RS = Stmt.executeQuery (strsql);

转载请注明原文地址:https://www.9cbs.com/read-63081.html

New Post(0)