我正在尝试使用以下库读取加密的Access .mdb:
按照Ucanaccess's documentation简单地实现JackcessOpenerInterface:
public class CryptCodecOpener implements JackcessOpenerInterface {
public Database open(File fl, String pwd) throws IOException {
DatabaseBuilder dbd =new DatabaseBuilder(fl);
dbd.setAutoSync(false);
dbd.setCodecProvider(new CryptCodecProvider(pwd));
dbd.setReadOnly(false);
return dbd.open();
}
}
我得到以下异常:
Exception in thread "main" java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/TouchCollector
at com.healthmarketscience.jackcess.CryptCodecProvider.__cobertura_init(CryptCodecProvider.java)
at com.healthmarketscience.jackcess.CryptCodecProvider.<clinit>(CryptCodecProvider.java)
at com.decode.CryptCodecOpener.open(CryptCodecOpener.java:29)
at net.ucanaccess.jdbc.DBReference.<init>(DBReference.java:161)
at net.ucanaccess.jdbc.DBReferenceSingleton.loadReference(DBReferenceSingleton.java:51)
at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:99)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.decode.Importer.importFromDatabase(Importer.java:41)
at com.decode.Main.main(Main.java:10)
Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.coveragedata.TouchCollector
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
从我收集的内容来看,Cobertura是Java的代码覆盖实用程序。这只是一个坏罐子还是我做错了什么?