 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Daniel Marzano Guest
|
Posted: Thu Nov 13, 2003 5:17 am Post subject: Opening db files contained inside a jar file problems. |
|
|
Hello,
I am trying to read some HSQLDB db files from within a jar file, but I
am not having much success. If anyone could point me in the right
direction it would be much appreciated.
The four db files are definately in the jar file and are called:
spiders.backup
spiders.data
spiders.properties
spiders.script
and the jar file is in the location:
M:/dmarzano/LucidPlayer.jar
The following is the code that I am using to open the db connection
and for testing purposes.
URL url = KeyDataIOManager.class.getClassLoader().getResource(
"spiders.properties");
String name = url.toString().substring(0,
url.toString().lastIndexOf(".")); // not the most efficient way, but
Im testing
System.out.println("URL: " + url.toExternalForm());
is = url.openStream();
System.out.println("Input Stream: " + is);
workDBConn = DriverManager.getConnection("jdbc:hsqldb:" + name,
"sa", "");
The output from the println calls is:
URL: jar:file:/M:/dmarzano/LucidPlayer.jar!/CBIT_Java_Projects/spiders.properties
Input Stream: java.util.jar.JarVerifier$VerifierStream@16877f8
The exception that I get after the call to DriverManager.getConnection
is:
java.sql.SQLException: File input/output error:
jar:file:/M:/dmarzano/LucidPlayer.jar!/spiders.properties
java.io.FileNotFoundException:
jar:file:M:dmarzanoLucidPlayer.jar!spiders.properties (The
filename, directory name, or volume label syntax is incorrect)
I can succesfully open an input stream to the file, it fails after
that. Any ideas? Has anyone tried opening db files that are contained
inside a jar file? What about hsqldb database files?
Thanks,
Daniel Marzano
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|