Have a look at this link. It contains all the information you needto make a connection plus a lot of examples:http://dev.mysql.com/doc/connector/j/en/index.html