Copy JDBC Driver:mysql-connector-java-5.1.20-bin.jar to /usr/local/apache-tomcat-7.0.55/lib
Config DBCP(Data Base Connection Pool) in /usr/local/apache-tomcat-7.0.55/conf/server.xml put the following contents to Host component.
Open Terminal and execute the following commands to open Finder navigated to the specified location.
cd /usr/local/apache-tomcat-7.0.55/webapps open -a Finder .
Create folder NepenthesDemo under /usr/local/apache-tomcat-7.0.55/webapps
Create folder WEB-INF under /usr/local/apache-tomcat-7.0.55/webapps/NepenthesDemo
Create folder lib under /usr/local/apache-tomcat-7.0.55/webapps/NepenthesDemo/WEB-INF
Copy the following libs to /usr/local/apache-tomcat-7.0.55/webapps/NepenthesDemo/WEB-INF/lib
Create web.xml file with the following content and save to /usr/local/apache-tomcat-7.0.55/webapps/NepenthesDemo/WEB-INF
Now you have finished Tomcat configuration linked with MySQL database. In order to make the new web application working properly,make sure to shutdown Tomcat and start it again. Then visit http://localhost:8088,if there is no error,that means your configuration is correct.
cd /usr/local/apache-tomcat-7.0.55/bin sudo ./shutdown.sh sudo ./startup.sh