• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Database Location

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have designed and coded my app to work as follows:
First a dialog box is displayed with two radio buttons, one for local database the other for network database. If the user selects local database, the app begins and uses the db.db file in a default location on the localhost. If the user selects network database, a second dialog box is displayed with a text field for the user to enter the remote server's hostname. Then the app begins and attempts to use the db.db file in the same default path on the remote server.
I have however, just realized that the requirements state the following: "the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used".
Here's my question: Must I provide a way for the user to specify the path of the db.db file? What is everyone's interpretation of "location of the database"? Might that just mean the machine where the database is located?
Thanks for the help,
Joe
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe it is necessary to allow the user to specify the database file location. In addition to the requirement you mentioned, I had a requirement that "the user must not be required to install the files in a specific location."
My only required command line argument is "database location". This can either be the path to the file or the binding url for my RMI server. If the user types "local" after this argument it is taken as a file path, otherwise I interperate it as a url.
Hope this helps,
Matt
 
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Matt/Joe,
Can we just put the db.db in a fixed directory within our directory structure. As long as our whole directory structure is loaded in a thecomputer (as long as the examiner sets classpath and path correctly), then we do not need the user/examiner to worry about where the db.db is. The program will work on relative directory.
I assume the examiner will set classpath/path, since we do not know where his/her computer setup for the JDK directory.
Please comment
Ruilin
 
Matt Cannata
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ruilin,
I'm not sure whether or not your approach will meet your requirements, but I don't think it's a good idea to hardcode the location of the database file into the program. If someone wanted to change databases, they'd have to rename their database file "db.db" and move it to the location you have set. By allowing the user to specify the location of the database, the server will be able to service any properly formatted file.
The constructor of the Data class takes the filename as an argument, so allowing the user to specify the file location only means getting the argument from the commandline and sending it to the constructor.

Matt
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Matt,
Thanks for your great comments. It make a very good sense.
Ruilin
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a clarification required ..
IS it a requirement that user can give the db.db file in ASCII
format & there should be a routine to convert from ascii to binary ? In submission requirement this point has not been clearly mentioned .
thanks for any information provided
 
reply
    Bookmark Topic Watch Topic
  • New Topic