我在我的程序中使用Type 5 DataDirect JDBC Drivers,但是当我运行这个程序时,我得到一个例外:
java.sql.SQLException:找不到合适的驱动程序 JDBC:DataDirect的:MySQL的://本地主机:?3306 / jmysql useSSL =假
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)