java - Struts 1 and connection-pooling -


I have been able to use connection-pooling in my web app (which does not use the struts framework). Now I need to integrate the part written by another developer (part using Straits 1 framework) The problem is that I am not able to use the pool with Stropes 1.

Is this possible?

My Tomcat Reference. In Xml, I have:

    

Another developer is using a connection from the servlet executable such as:

  class. ForName ("com.mysql.jdbc.Driver"); Conv = (connection) DriverManager.getConnection ("jdbc: mysql: // localhost: 3306 / mydb", "auser", "apwd");    

Use some code in the subletes like this

 < Code> // Get our environment naming context reference initCtx = new InitialContext (); Reference envCtx = (context) initCtx.lookup ("java: comp / env"); // View our data source datasource ds = (datasource) envCtx.lookup ("jdbc / MyDB"); // Allocate connection to the pool and use Connection conn = ds.getConnection (); ... Use this connection to access the database ... conn.close ();   

For more details, see



Comments