title: Where should the JDBC driver JAR files reside on a Tomcat deployment with a datasource?
body: <p>I have java web application using Spring, Hibernate, Tomcat7 &amp; MySql. I use Datasource for database operations. I am not very clear about what is the standard location to load the jar files (<code>Tomcat-jdbc.jar</code> &amp; <code>Mysql-connector.jar</code>) from? It works if I keep BOTH the jars either in <code>CATALINA_HOME/lib/</code> or <code>webapps/myApp/WEB-INF/lib</code>. But I was told to use only the Tomcat-jdbc from CATALINA_HOME/lib/ and <code>mysql-connector.jar</code> from <code>/WEB-INF/lib/</code>, which gives a <code>ClassNotFound</code> Exception for <code>Sql Driver</code>. Can someone let me know which is the right location for these jars?  </p>
  
  <pre><code>&lt;bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource"
          destroy-method="close"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="url" value="${db.url}" /&gt;
          &lt;property name="username" value="${db.username}" /&gt;
          &lt;property name="password" value="${db.password}" /&gt;
          &lt;property name="initialSize" value="${db.initialSize}" /&gt;
          &lt;property name="minIdle" value="${db.minIdle}" /&gt;
          &lt;property name="maxActive" value="${db.maxActive}" /&gt;
          &lt;property name="maxIdle" value="${db.maxIdle}" /&gt;
          &lt;property name="testWhileIdle" value="${db.testWhileIdle}" /&gt;
          &lt;property name="minEvictableIdleTimeMillis" value="${db.minEvictableIdleTimeMillis}" /&gt;
          &lt;property name="timeBetweenEvictionRunsMillis" value="${db.timeBetweenEvictionRunsMillis}" /&gt;
          &lt;property name="validationQuery" value="${db.validationQuery}" /&gt;
      &lt;/bean&gt;
  </code></pre>