AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Opening db files contained inside a jar file problems.

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
Daniel Marzano
Guest





PostPosted: Thu Nov 13, 2003 5:17 am    Post subject: Opening db files contained inside a jar file problems. Reply with quote



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 Smile
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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.