


There are two parts to this blogpost – the first part talks about how to install Apache Tomcat on Ubuntu by yourself, and the second part talks about the best hosting platforms available to host Tomcat applications. Select the runtime you want to use (in our case, Tomcat 7) and give a name to your project.Learn how to install Tomcat and some of the cloud hosting option to deploy your Tomcat applications. You can easily create a web project in Eclipse by following these steps: File -> New -> Dynamic Web Project. Since this is out of the scope of this article we are going to give some general instructions on how to do it, and you can take a closer look at the code attached at the end of this example. In order to make use of the instructions that will follow, and see for yourself how to use JDBC with Tomcat, you need to create a new web project consisting of servlets and jsp pages, that will make use of Tomcat web server for deployment. 2.2 Create a Dynamic Web Project application in Eclipse Just add the jar file in there (along the other jar files that tomcat uses) and you are done with this step. For instance, since we are using Windows, the directory that we are using in this example is C:\tomcat7\lib. In this case however, we need to put the jar file in out Tomcat installation directory, specifically in the $CATALINA_HOME/lib sub-directory. 2.1 Download MySQL Connector and put it in the right folderĪs seen before, we need to download the MySQL Connector from the official MySQL website, and use the mysql-connector-java-5.1.31-bin file. Let’s take a look on what needs to be done. In this case, we still have to use the connector jar file (in a specific folder), as well as make some xml configuration changes.


In order to integrate Tomcat and JDBC we are going to follow a different process from before. That was it, you are now ready to start using MySQL in your application! 2. You can see that the jar is added in the build path under the Referenced Libraries section, in the project structure. The path you should follow to add the jar, as instructed above.
