GhostHacks96 GhostHacks96 - 11 months ago 50
Java Question

Java jdbc mysql error

I'm working on a program for fun but the

driver and connection code isn't working properly I got the error

Error: no suitable driver found

MeanWhile my code contains the
line. I have the newest
jar file in my class path. any suggestions I could try to fix the problem

private void connect() {
try {
con = DriverManager.getConnection(URL,user,pass);
stmt = con.createStatement();
} catch (Exception e) {
error = true;


Your issue is in the syntax of the URL which is not correct you forgot the colon after mysql, it should be jdbc:mysql://... for more details about the syntax of the URL in case of mysql please refer to this web page