GeeCON Prague 2014*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Data class Exceptions. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Data class Exceptions." Watch "Data class Exceptions." New topic
Author

Data class Exceptions.

Gurpreet Saini
Ranch Hand

Joined: Jun 09, 2002
Posts: 295
Hi reader,
Are the exceptions defined in Data class are to be catch there itself such as the same original code is or shall they be defined on method header, especially IOException such that client may be notified that what problem had occured on db side.
Thank you,
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Gurpreet,
If the Data method threw DatabaseException, I also threw it in my DataAccess interface and let the client deal with it. I also threw my own DatabaseExceptions in some other cases like attempting to modify a record without owning the record lock. I also created an InvalidDataFileException which extended IOException, but it was only for initial integrity check on server boot.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data class Exceptions.