aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Checking if db file exists a requirement? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Checking if db file exists a requirement?" Watch "Checking if db file exists a requirement?" New topic
Author

Checking if db file exists a requirement?

Sean Gildea
Ranch Hand

Joined: Jul 01, 2004
Posts: 81
Hey Everyone,

When my application first starts up, it does not check if the database file exists in any mode. I dont recall any specific requirements to check if it exists in 1.2.2 URLyBird

I'm having doubts though, incase the examiner tests my program to run without the dbfile. Should I display something to the user in network/standalone if the db file does not exist?

Should the server mode even start at all if the dbfile does not exist? Or worse, allow the user to specify the location of the database?

How did others handle this problem?

Thanks in advance!


SCJD, SCBCD, SCJP
Daniel Simpson
Ranch Hand

Joined: Sep 02, 2004
Posts: 181
Originally posted by Sean Gildea:
Hey Everyone,

When my application first starts up, it does not check if the database file exists in any mode. I dont recall any specific requirements to check if it exists in 1.2.2 URLyBird

I'm having doubts though, incase the examiner tests my program to run without the dbfile. Should I display something to the user in network/standalone if the db file does not exist?

Should the server mode even start at all if the dbfile does not exist? Or worse, allow the user to specify the location of the database?

How did others handle this problem?

Thanks in advance!


Hey Sean, I'm taking B&S 2.1.3 right now, so I don't know how different our specifications are from each other. My instuctions say that all configuration needs to be done through a GUI and persistent throughout each time using a Properties file. Basically, in local mode, I allow the user to configure the settings by searching for the database file, or in network mode, whoever runs the server is able to choose the location of the db file. When they launch the application the next time, it checks to see if that properties file exists. It then checks and sees if a specific key-value is stored in that properties file. If so, it allows the user to 1)reconfigure settings or 2)use the existing settings. So basically, my big check is first to see if the properties file exists and then for a specific value (because a person could configure settings for network mode and not local, and if they tried to use network settings for local mode, the program would crash). I hope this helps!
[ December 30, 2004: Message edited by: Daniel Simpson ]

SCJP 1.4<br />SCJD 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Checking if db file exists a requirement?
 
Similar Threads
NX : throwing RecordNotFoundException?
Logical/File Locking and nested synchronisation
specify db file on the server or the client?
how can you avoid nested synchronization
B&S suncertify.properties