To use mySql in your java projects in eclipse first go to http://dev.mysql.com/downloads/connector/j/ and download the connector, for example:
Finally copy it to your lib folder, for example:
Go to the eclipse, right button on the project name and select “Refresh”.
Pay atention, to use the new imported jar you have to add one of the following imports to your classes: