I was wondering if anyone can help me I am trying to connect to an online database. The database is placed on http://labs.cms.gre.ac.uk/db/mysqlnew.php but i can't seem to connect, heres what I have so far, can anyone help?
Plus do i need import anything? I have import.hava.sql.*; but that is it?
try {
System.out.println("Attempting Database Connection");
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://http://labs.cms.gre.ac.uk/database";
connection = DriverManager.getConnection(url, "user", "pass");
stmt = connection.createStatement();
System.out.println("Connection made");
} catch (Exception e) {
System.out.println("Database connection attempt failed");
System.out.println(e);
}
}