aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Choosing the database file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Choosing the database file" Watch "Choosing the database file" New topic
Author

Choosing the database file

Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Hi Team
In my assignment solution, i am allowing the user to specify the database file with location using FileDialogBox in local mode. The user can choose any .db file which has the correct format. This means that the database file name need not be db.db. It can be abc.db or db30july.db etc. But extension should always be .db
This provides more flexibility.
Is it correct ?
Should i ask user to only specify the location/directory of the database file and i assume the database file name always to be db.db
How others have handles it ?
[ July 17, 2002: Message edited by: Amit Kr Kumar ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17231
    
    1

You can definitely provide that flexibility.
Do you handle the situation of the usrer selecting an invalid file that is not a db file, and when it tries to open it, it throws an exception?
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Thanks Mark
Yup i have handled itas Data.java will throw IOException if it is not in expected format

Amit
friso dejonge
Ranch Hand

Joined: Jul 11, 2002
Posts: 162
Hi,
I do not think this is in the requirements. Think of a situation when you are in a customer situation, would you build it as well, even if the customer did not include this in the requirements and will therefore not pay for it ?
I agree however that this project is more about learning java/patterns etc and not about a client situation. Therfore if you want to do it, just go ahead, but indeed do as mark S. says, make sure you have exceptions handled. Also make sure that your views work with different models / database layouts, that if you open another db file with
different fields, that everything still works.
good luck
regards,friso


swimming certificate (A & B), shoelaces diploma, and some useless java ones.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17231
    
    1

that if you open another db file with
different fields, that everything still works.

It doesn't need to work with a db that has different fields. And yes this can be construed as extra work, but the JFileDialog is easy to implement, and won't hurt his points.
Mark
Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Hi Mark
But how to determine whether selected db.db has the expected fields in it, though this can be checked whether it is in the format expected by Data class
Amit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Choosing the database file
 
Similar Threads
should we open the db.db at Server startup?
command line arguments
Database path + Database name ?
URLy Bird: database location
location of DB.DB file