seems to work fine Tomcat automatically adds container managed connection pooling to every resource of type jaxaz.sql.DataSource. The library that provides this pooling (a package renamed version of Commons DBCP) is loaded by the shared class loader (which in a default config is the same as the common loader). The pooling implementation needs to be able to load the configured JDBC driver and the shared (and common) loader does not have visibility into the web application class loaders. Therefore, the JAR with the JDBC driver needs to be in the $CATALINA_BASE/lib directory so it can be loaded. However, as of r754776, DBCP falls back to the Thread's context class loader if it can't load the specified Driver. If the thread context class loader is set to the web application's class loader then the Driver can be loaded. This change was included in DBCP 1.3 and 1.4 onwards which means it was included in 5.5.30 onwards, 6.0.27 onwards and every 7.0.x release. It will also be in every 8.0.x release.
JDBC using Tomcat-DBCP requires JDBC driver in Tomcat's own /lib
wish helps you The answer to your first question is the very link you reference in your second question. That's why you should put JDBC drivers in /lib. Normally people advise against using /lib but JDBC drivers are a big exception. For your second question, the workaround is to put it in Tomcat's shared /lib folder. That's it. That is the fix.
Cannot load JDBC driver class 'com.mysql.jdbc.Driver' Tomcat 8 & Eclipse