我是 Jena SDB 的新手。我已将 SDB-1.2.3.jar 包含在类路径中,并且数据库在线并使用此连接字符串。但是程序在第一行就崩溃了。请帮助我,并给我一些关于 SDB-Jena 的有用教程链接。我已经在他们的官方网站上试过了。我的代码来自网站“http://jena.apache.org/documentation/sdb/javaapi.html”
StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash,
DatabaseType.MySQL ) ;
JDBC.loadDriverMySQL();
String jdbcURL = "jdbc:mysql:localhost:3306/test?username=root&password=1&database=test";
SDBConnection conn = new SDBConnection(jdbcURL, null, null) ;
Store store = SDBFactory.connectStore(conn, storeDesc) ;
但是编译器给了我以下异常
Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/sparql/ARQException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at jenasdb.JenaSDB.main(JenaSDB.java:45)
Caused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.sparql.ARQException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 13 more
Java Result: 1