Hi, i have a problem with the testDb file.
I use Eclipse for my project and TestDb run perfect. But I have a problem when I packed my application in a Jar file. With my .jar I export HSQLDB.jar. But when the program process this line:
Class.forName("org.hsqldb.jdbcDriver");
..the message is this:
java.lang.ClassNotFoundException: org.hsqldb.jdbcDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at pippo.testdb.<init>(testdb.java:59)
at pippo.testdb.main(testdb.java:156)
C:\Documents and Settings\Svenson\Desktop>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, i have a problem with the testDb file.
I use Eclipse for my project and TestDb run perfect. But I have a problem when I packed my application in a Jar file. With my .jar I export HSQLDB.jar. But when the program process this line:
Class.forName("org.hsqldb.jdbcDriver");
..the message is this:
java.lang.ClassNotFoundException: org.hsqldb.jdbcDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at pippo.testdb.<init>(testdb.java:59)
at pippo.testdb.main(testdb.java:156)
C:\Documents and Settings\Svenson\Desktop>
It's saying it can't find the HSQL drive which is in the HSQLDB>JAR. Just add a -classpath statement in you java cmd statement.
java -classpath location\hsqldb.jar -jar your.jar