问题
I keep getting the 'No suitable driver found' in my database and I can't pin down what's wrong with my connect class? Any help? I've got all 5 jars in. I want to connect to a Microsoft Access Database.
import java.sql.*;
public class Connect
{
public Connection con;
Statement st;
public Connect()
{
try {
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
Connection con=DriverManager.getConnection("jdbc:ucanaccess:E://EclipsePortable//Data//workspace//ThisWillWork//res//Railway.accdb");
Statement st = con.createStatement();
}
catch(Exception err) {
System.out.println(err);
}
}
}
回答1:
your jdbc url is wrong, you lost a //, see other examples
来源:https://stackoverflow.com/questions/37121700/ucanaccess-no-suitable-driver-found