Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

problem of database

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sun request:
1 . the program must allow the user to specify the location of the database
2 . and it must also accept an indication that a local database is to be used .

This is the most difficult thing in my cetification examination . I have no idea how to deal with it .
To 1 . Should i make a JTextField in GUI and allow the user to enter the path of the database file ?
To 2 . when i start the program with argument "alone" , the local database be used .

Wait for your idea . Thank you , thank you very much .
Yours David
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This specification calls for a preferences dialog, can't you hear it shouting?
Have a default URI for your DB on deploy and make it configurable in the preference dialog. If you want to, you could save the URI in a Properties file.

HTH, Chris
 
David George
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It must also accept an indication that a local database is to be used.

Does this means that i use the argument "alone" to launch the program , default use the local database?
 
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David George:
It must also accept an indication that a local database is to be used.

Does this means that i use the argument "alone" to launch the program , default use the local database?



David don't rush into it, sit back and read the instructions a couple of times, that should help clear it up.
To answer your question alone means no server is running, "server" I believe starts the server and no argument means start the GUI client but connect to the default or previously used server.
 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i can confirm that the previous writer is exactly right. two flags, three modes, everything makes sense at the end of the day ;-)

greetings,
jan
 
Your mother is a hamster and your father smells of tiny ads!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic