• 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

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

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sam Codean
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmm.. I get the point. Thanks for the help.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic