我知道下面的代码适用于Microsoft Access数据库,但我需要将其切换到我的远程SQL服务器。
try {
String driver = "net.ucanaccess.jdbc.UcanaccessDriver";
Class.forName(driver);
conn = DriverManager.getConnection("jdbc:ucanaccess://???SQLSERVERPATH???");
} catch (Exception e) {
System.out.println(e);
}
那么我在哪里弄清楚服务器路径是什么?
答案 0 :(得分:0)
UCanAccess JDBC驱动程序仅用于处理存储在Microsoft Access数据库文件(.accdb,.mdb)中的数据。它不能用于处理SQL Server数据库中的数据。您需要使用SQL Server JDBC驱动程序(例如,this one)。