I need to know if it is possible to use connection pooling in Tomcat without having the JDBC driver (MySQL Connector/J in my case) inside commons/lib directory, but inside your WEB-INF/lib instead? I have tried doing this, of course, and it doesn't seem to work, but I can't be sure if it is a problem with my configuration. With the driver present in commons/lib, it works as normal. I searched around quite a bit, but I keep running into conflicting information. Is there a chance of conflict if I put the JDBC driver in both commons/lib and WEB-INF lib? For the reference I am using Tomcat 6.0.16 and Connector/J 5.1.6. My context.xml is as follows:
Any thoughts on this?
[ October 13, 2008: Message edited by: Veggen Skrikk ] [ October 13, 2008: Message edited by: Veggen Skrikk ]
Originally posted by Veggen Skrikk: I need to know if it is possible to use connection pooling in Tomcat without having the JDBC driver (MySQL Connector/J in my case) inside commons/lib directory, but inside your WEB-INF/lib instead?
I would say no. If you want the container to manage your connections, the JDBC driver has to be in the container's classpath, not the application's.
Even if you do have the MySQL driver at the web app level at WEB-INF/lib Tomcat will use the driver located at TOMCAT_HOME/common/lib. The driver located at WEB-INF/lib will not be 'visible' to Tomcat classes.
I dont see any conflict if you do have the driver at both locations, but what is the need for the driver to be available at the web app level?
Joined: Apr 08, 2008
Ok people, thanks a lot for clearing it up for me! I'm grateful. Oh, and I asked if driver being present on both location would cause a conflict only because I accidentaly shipped an application with a copy of the driver in WEB-INF/lib and I was afraid it might cause troubles.
subject: Connection pooling question: Can MySQL Conector/J be in WEB-INF/lib?