Setting Mysql for java in eclipse

Download the Jar file from the mysql website

Download the one JDBC Driver for MySQL (Connector/J)

Unzip/untar the contents of the download file. 

Open your project in eclipse

Go into project/properties.

Select "Java build Path" and click on Libraries.

Click on button called "Add External Jar's".

Open a browsing dialog and navigate to the directory that you've extracted mysql connector/j into and select "mysql-connector-java-*.jar" file.

Same you need to add in tomcat lib director if you are using same.

Where * can be any value like 5.1.12-bin.