MYSQL DriverManager error

Discussion in 'Programming' started by DaanSander, May 1, 2015.

  1. Hello i am trying to connect to my database but when i do that i get a SQLException but when i ty it on my spigot plugins it works just fine

    error:
    Code (Text):
    java.sql.SQLException: No suitable driver found for jdbc:mysql://play.zsinfo.nl:3306/daansander
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at me.daansander.login.database.MySql.getConnection(MySql.java:28)
        at me.daansander.login.database.Sql.connect(Sql.java:13)
        at me.daansander.login.Login.main(Login.java:11)
    place of error:
    Code (Text):
    connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + db, user, pass);
     
  2. the driver isn't in the classpath, google "java mysql driver", download the .jar from oracle and add it to your classpath
     
    • Agree Agree x 1
    • Winner Winner x 1