GhostHacks96 GhostHacks96 - 1 year ago 90
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;

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download