I downloaded a driver from mysql.com/products/connector, unziped it, added the drivers .jar file to the class path variable. c:\mysql\mysql-connector-java-5.0.4-bin.jar
in the class file i have
import java.sql*.;
and in the ButtonLinstener method i have
System.out.println("Inserting values in Mysql database table!");
Connection con = null;
String url = "jdbc:mysql://localhost/ContactList";
String user = "root";
String pw = "marty95";
String driver = "com.mysql.jdbc.Driver";