Tomcat connection pool configuration

xiaoxiao2021-03-06  82

factory org .apache.commons.dbcp.basicDataSourcefactory driverclassname com.microsoft.jdbc.sqlser.sqlserverdriver URL

JDBC: Microsoft: SQLSERVER: //218.246.85.65: 1433; DatabaseName = zcmis

Alue> Username sa password sa maxactive 30 maxidle 10 maxwait 1000

Add the following to Web.xml DB Connection JDBC / TESTDB javax.sql .Datasource Container internal implementation

Try {context initctx = new initialcontext (); context ctx = (context) INitctX.lookup ("java: comp / env"); // Get connection pool object Object obj = (Object) CTX.lookup ("JDBC / TestDB" ); Javax.sql.datasource DS = (javax.sql.datasource) OBJ; connection conn = ds.getConnection ();} catch (e) {system.out.print (E.TOSTRING ());}

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

New Post(0)