1
我在Eclipse插件項目中使用了Jackcess API。我在資源下添加了jackcess-2.1.0.jar
文件/ lib。我在我的二進制版本和build.properties
下包含了這個jar。我成功地使用連接字符串進行連接,但是我的DatabaseBuilder.open()
調用未執行。我的代碼是Jackcess DatabaseBuilder.open失敗
public void run() {
try {
File tempTarget = File.createTempFile("eap-mirror", "eap");
try {
this.source = DriverManager.getConnection(EaDbStringParser.eaDbStringToJdbc(sourceString));
this.source.setReadOnly(true);
try {
FileUtils.copyFile(new File(templateFileString), tempTarget);
} catch (IOException e) {
e.printStackTrace();
}
// Changes
try {
this.target = DatabaseBuilder.open(tempTarget);
} catch (IOException e) {
e.printStackTrace();
}
Collection<String> tables = selectTables(source);
long time = System.currentTimeMillis();
for (String tableName : tables) {
long tTime = System.currentTimeMillis();
Table table = target.getTable(tableName);
System.out.print("Mirroring table " + tableName + "...");
table.setOverrideAutonumber(true);
copyTable(table, source, target);
System.out.println(" took "+ (System.currentTimeMillis() - tTime));
}
System.out.println("Done. Overall time: "+ (System.currentTimeMillis() - time));
System.out.println("done");
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
// More Code here
} catch (IOException e1) {
}
}
當我運行在調試模式中類和我達成DatabaseBuilder.open
呼叫失敗。
這裏是我的項目結構:
誰能告訴我它可能的原因是什麼?
異常的真正Access數據庫文件被拋出,你就吞嚥下去? – Kayaman
沒有異常拋出我正在捕捉異常但沒有拋出異常我認爲 – wearybands
Jackcess 1.2.6是一個非常舊的版本。爲什麼不使用[當前版本](http://sourceforge.net/projects/jackcess/files/latest/download?source=files)有沒有特別的原因? –