wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes What if the ***.db file itself is missing? 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 "What if the ***.db file itself is missing?" Watch "What if the ***.db file itself is missing?" New topic
Author

What if the ***.db file itself is missing?

Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
Hi All,
This is a very big mistake that will never happen ideally but has someone thought of this one?
What if the database file itself is not present? This could happen if the user keys in a wrong address for the Database file. Where do we stop the user from using the application?
The server and client are both independent and so in my program at max i can stop the server but what about the standalone mode?
Any hints on this one?


-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
If the file doesn't exist you can't connect to it so you display an error message.
The user can then try again.

Should be no different in each of the three modes.


42
Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
Okay so that exception goes all the way to the client right. But that also means that i need to check for this DBFile Not being Found in all the method calls :-(
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
not really, just at the place where you connect.

I'd consider the scenario where the database file gets deleted while the program is running to be one where an application crash is warranted.
If you have to allow for that you'd also have to program against a missing classfile at runtime for example.

What does happen (at least in my implementation) is that if a database operation fails an exception gets propagated up to the client and a message displayed to the effect.
That would be automatic, you already have to deal with IO exceptions after all.
Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
hmm.. I get the point. Thanks for the help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What if the ***.db file itself is missing?
 
Similar Threads
How to process the networking with a local database?
B&S: Command Line
unable to find url
Should server configuration be provided by suncertify.properties ?
Server Side GUI Implementation