How To Connect Jsp And Mysql Using Eclipse

This tutorial will teach you how to connect MySQL database and JSP on eclipse. I really had a hard time connecting JSP and MySQL since I could not find any right resource on the internet. So, I thought I would share my experience. Here am using eclipse indigo.

Getting Started


      1. Apache Tomcat web server

       2. Mysql Server.

Step1: Create a dynamic web project by going to File–>New–>Dynamic web project.

Recommended: JSP, Servlets, and JDBC for Beginners: Build a Database App

Step2: Give your project a name and select the target run-time as Apache tomcat, that you have installed in your system already, and click finish.Now, you workspace is ready for the SQL connection test.

Step3: Create a new file called ConnectJspToMysql.JSP and paste the following code.

Step4: Download MySql connector and add it to eclipse. Dowload it here. Now unzip the downloaded file in some location.

Step 5: Now got to eclipse. Expand your project folder. Go to java resources–>Libraries–>Ear libraries and then right click on EAR libraries. You will see an option called configure build path. select that option and select “add external jar files”  and find the unzipped MySQL connector folder and select thejava-mysql-connector.jar file and click open.

That it, Now you can run your JSP program and you will get an output saying, connection established using TCP-IP.


Ruby on rails is an excellent framework for developing web apps using ruby. And to be clear, ruby on rails is not a…

Read more

How do I install latest ansible server on a Redhat or Centos 7 server? You can easily install the latest stable…

Read more
[SOLVED] Helm Error: no available release name found

When I ran helm install, I got "Error: no available release name found" error. What should I do? If you get no…

Read more

The Best Tutorials & Tips to Speedup Your DevOps Workflow.

Created by Bibin Wilson.