This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Loading database file from jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Loading database file from jar" Watch "Loading database file from jar" New topic
Author

Loading database file from jar

Torsten Wiederkehr
Greenhorn

Joined: Feb 20, 2004
Posts: 14
Hi @all,

I know that I must load the suncertify.properties from my runme.jar, using an URL. But must the database file also be loaded from the runme.jar? Or can I except that the user will enter the location of the database file and I can load it from the file system?


ciao torsten
mike acre
Ranch Hand

Joined: Sep 23, 2003
Posts: 197
No, suncertify.properties can not be loaded from the runme.jar
You can only (easily) read from a jar so how can you update new user properties?
You can optionally have defaults that are read from the runme.jar these will not be changed (by a user), but these will be overwritten by any properties found in suncertify.properties "which must be located in the current working directory" - not within the jar itself.
Obviously the whole submission is jarred up but you can assume this will be unjarred by the examiner.

The database file location is specified in the quoted 'must' you surely have - "The program must allow the user to specify the location of the database" - so this will apply to 'server' and 'alone' mode and yes, load it from the file system as specified by the user.


SCJP 1.4, SCJD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Loading database file from jar
 
Similar Threads
NX: Question about database location.
Final Submission
Can't find suncertify.properties file
User guide must include installation?
(NX:URLyBird)A question about properties files: