This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RecordNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RecordNotFoundException" Watch "RecordNotFoundException" New topic
Author

RecordNotFoundException

Maksym Odintsov
Greenhorn

Joined: Jan 22, 2009
Posts: 11
Hi. How do you think is it possible to make RecordNotFoundException and DuplicateKeyException subclasses of RuntimeException ?
I don't have any specification according to how to implement this two exceptions.
I want to do it, because in this way it will be easier to implement my server.
I have DataRemote interface which extends Remote and DB, my DataImpl class implements DataRemote. It means that I can treat DataImpl as DB.
But I can't throw any checked exceptions except RemoteException inside the methods of DataImpl class.

please help me solve this problem.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2379
    
    7

take a look at this for whether these exceptions should be subclass of RuntimeException or not.

I personally implement them as subclass of Exception.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: RecordNotFoundException