Type 5 DataDirect JDBC Drivers : No suitable driver found

342 Views Asked by At

I'm using Type 5 DataDirect JDBC Drivers in my program, but when I run this program then I get an exception:

java.sql.SQLException: No suitable driver found for jdbc:datadirect:mysql://localhost:3306/jmysql?useSSL=false.

public class Type5DataDirectDriver {

public static void main(String[] args) {
    Connection con = null;
    // Establish the Connection
    try {
        con = DriverManager.getConnection("jdbc:datadirect:mysql://localhost:3306/jmysql?useSSL=false", "root", "");

        // Verify the Connection
        DatabaseMetaData metaData = con.getMetaData();
        System.out.println("Driver Name: " + metaData.getDriverName());
        System.out.println("Driver Version: " + metaData.getDriverVersion());
        System.out.println("Database Name: " + metaData.getDatabaseProductName());
        System.out.println("Database Version: " + metaData.getDatabaseProductVersion());

    } catch(SQLException ex) {
        ex.printStackTrace();
    }
    finally {
        try {
            if (con != null) {
                con.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
}

ExceptionL

java.sql.SQLException: No suitable driver found for jdbc:datadirect:mysql://localhost:3306/jmysql?useSSL=false
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:703)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
at java9.Type_3MiddlewareDriver.main(Type5DataDirectDriver.java:14)
0

There are 0 best solutions below