0

I'm getting the error "No suitable driver found for jdbc:mysql://[...]" when running a Java program on Cloud 9 which has the following ConnectionFactory class:

    import java.sql.*;

public class ConnectionFactory {
    public static Connection getConnection() {
        try {
            return DriverManager.getConnection("jdbc:mysql:// [suppressed path, user and password details]");
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

}

I know this is because I should install the MySQL driver for Java in the server, but how do I do that in Cloud 9?

Marco.S
  • 383
  • 2
  • 10
  • 3
    add mysql connector jar to build path – Ramanlfc Oct 26 '15 at 12:36
  • 1
    add Class.forName("com.mysql.jdbc.Driver"); and mysql connector jar to build path – soorapadman Oct 26 '15 at 12:37
  • Possible duplicate of [No suitable driver found for 'jdbc:mysql://localhost:3306/mysql](http://stackoverflow.com/questions/8146793/no-suitable-driver-found-for-jdbcmysql-localhost3306-mysql) – RPresle Oct 26 '15 at 13:11

0 Answers0