• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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

 
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!
 
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
 
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
 
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
Boost this thread!