Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading database file from jar

 
Torsten Wiederkehr
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic