我一直在尝试使用 jackcess/ucanaccess 连接到本地计算机上的访问数据库。该数据库与共享点列表链接。连接发生,我可以从表中读取。当我删除指向其中一个访问表的共享点列表的链接并将其再次与共享点列表链接时,我收到以下错误:
TestJdbc.main()[CONSTANTS, f_0194596E3DC6402283A012D0661E7517_Attachments, f_41905A7F89E440EDBFA0B6B30C57EE68_CDAttachment, f_431F6C05710944EEA2F443EAC1A43A10_JOIN_XRef2Capability, f_6030D9CC0C874CF5A31AB134BBF1A10E_BackgroundAttachment, f_7EA55A8F5B1141E68CEECFD2DB672397_ProjectAttachment, LUT_Domain, LUT_Requirement_Types, LUT_XRef_Types, MASTER_ePlanProject, Name AutoCorrect Save Failures, t-Individual-Status, t-Role-System, TABLE_BackgroundAttachments, TABLE_Benefits, TABLE_Capabilities, TABLE_DepartmentImpact 、TABLE_LogHistory、TABLE_ProjectAttachments、TABLE_Requirements、TABLE_Terminology、TABLE_XRefs、UserInfo] 线程“主”java.io.FileNotFoundException 中的异常:给定文件不存在:https:\workspace.web.att.com\sites\ISDE\SmartIA;LIST= {4131DABC-4E9F-4F75-95DC-CE26A0F63EC3};VIEW=;RetrieveIds=是 在 com.healthmarketscience.jackcess.impl.DatabaseImpl.open(DatabaseImpl.java:365) 在 com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:252) 在 com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java :291) 在 com.healthmarketscience.jackcess.util.LinkResolver$1.resolveLinkedDatabase(LinkResolver.java:42) 在 com.healthmarketscience.jackcess.impl.DatabaseImpl.getTable(DatabaseImpl.java:984) 在 com.healthmarketscience.jackcess.impl .DatabaseImpl.getTable(DatabaseImpl.java:928) 在 com.healthmarketscience.jackcess.impl.DatabaseImpl.getTable(DatabaseImpl.java:81) 在 com.attprism.rest.common.TestJdbc.main(TestJdbc.java:54) 14 :17:24.843 错误:[PacketDispatcher.cpp:154] 运行:执行命令时出现异常:TransportException [510/201] 没有t 与调试器的开放连接
我的代码看起来像这样
package com.attprism.rest.common;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Set;
import com.healthmarketscience.jackcess.Database;
import com.healthmarketscience.jackcess.DatabaseBuilder;
import com.healthmarketscience.jackcess.Row;
import com.healthmarketscience.jackcess.Table;
public class TestJdbc {
public static void main(String[] args) throws IOException, SQLException,
ClassNotFoundException {
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
Database db = DatabaseBuilder.open(new File(
"C://Users//sm501y//Desktop//SmartIA_ODBC.accdb"));
Set<String> tables = db.getTableNames();
System.out.println("TestJdbc.main()" + tables);
Table table = db.getTable("CONSTANTS");
for (Row row : table) {
System.out
.println("Column 'a' has value: " + row.get("Project_ID"));
}
}
}
请问有什么帮助吗?