File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Loading database file from jar" Watch "Loading database file from jar" New topic

Loading database file from jar

Torsten Wiederkehr

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

I know that I must load the 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, 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 "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.

I agree. Here's the link:
subject: Loading database file from jar
It's not a secret anymore!