1. Gather requirements :
- Tomcat 5.5 or above
- MySQL database server
- Connector: mysql-connector-java-3.1.7-bin.jar
2. Place the mysql connector in CATALINA_HOME/common/lib
3. Create your own sample web app say "myApp".
4. Then place this XML Context tag entry in server.xml (CATALINA_HOME/conf/server.xml) inside .........
Note that ,the username ,password are your MySQL credentials.
5.Then we have to tell the server container where is our jdbc data source is , when running our web app.So for that we have to enter the following resource ref tag entry in your web.xml.
6. Then you only have to do is make a datasource and get a connection with a MySQL DB in your webapp ,say inside a jsp and call it.Here is the code
/**
*/
THATS IT.SIMPLE............ENJOY J2EE.......!