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?
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.
Joined: Feb 26, 2006
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
Joined: Apr 21, 2006
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.