UCanAccess: No suitable driver found

余生长醉 提交于 2021-01-28 20:22:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!