connection pooling with dbcp
I am building an application where I need to use connection pooling. I am using Tomcat and mysql. I have previously used connection pooling based on an example, and it used Struts GenericDataSource. This worked well, however I read that it is not production quality, so I am trying to modify it.
Because Tomcat 4.1 now included the commons dbcp, I thought that I will just replace Struts's GenericDataSource with dbcp's BasicDataSource. I am trying not to modify the server.xml and include the parameters for the servlet in the web.xml
The problem is that my java file does not find the org.apache.commons.dbcp.BasicDataSource. All the commons jar files are in the common/lib directory of tomcat. I also placed them in the classpath and in the applications lib directory (just in case)
Can anyone help?
My code looks like this and the DBInitServlet is initialised when the application is uploaded. This and all parameters are specified in the web.xml
//From Beginning JSP Web Development, 2001 Wrox, ISBN 1861002-09-2