Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How did you go about server reading data filу when started from jar?

 
Roman Yankin
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty close to submission and I have one of those questions I want to be sure about.

My "client" application makes use of JFileChooser to allow opening the data file, but my server does not use any swing components (i've made it purely command line) so when it starts it should look for the db file at some place, what would you suggest me to do? To go ahead and open JFileChooser at server startup or perhaps to specify path to data file in suncertify.properties?

I'm looking for some classic solution to this problem and would not really like to invent something that nobody has ever done before.

Thanks in advance!
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would open the JFileChooser at server startup, with the jar's current directory displayed.

I saved the "last used directory" in my property file, so next time the server was launched, the "last used directory" was displayed.

Regards,
Alex
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Server application has a textfield to type the database file location. It also has "Browse" button to open the JFileChooser.

Jeffry Kristianto Yanuar
Java Instructor
SCJP 5.0
SCJA
SCJD (Working on UrlyBird 1.3.2) --> testing and documenting the assignment
 
Jethro Borsje
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't implemented it yet, but I am going for the JFileChooser this seems the most user friendly to me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic