So I've been teaching myselft mysql and am trying to integrate it into my Java code. I've looked at some past code snippets and tutorials and I can't seem to figure out why my code is incorrect. (removed password for obvious reasons)
Here's what I'm using to connect
public static void connectionToMySql(){
String host = "mysql9.000webhost.com";
String username = "a9808220_pin";
String pass = "";
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection(host,username,pass);
/*insert code*/
connection.close();
System.out.println("It worked :)");
} catch (Exception e) {
System.out.println("Something went wrong :(");
e.printStackTrace();
}
}
I get an exception that there's no suitable driver. I'm not sure why because I have the jar downloaded and pathed correctly