I'm trying to connect to my msql database, but keep getting the error: No suitable driver found for jdbc:mysql://localhost:3306/test3.
try{
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test3" , "root", "julius");
Statement statement = (Statement) con.createStatement();
String insert = "INSERT INTO testtable VALUE ('Guy' , '0156421";
statement.executeUpdate(insert);
}catch(Exception e){
System.out.println("ERROR: " + e.getMessage());
}
I have not installed any mysql connector, but since I could import java.sql.Connection;, java.sql.DriverManager;, java.sql.Statement; I guess that wasn't needed.