This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RecordNotFoundException" Watch "RecordNotFoundException" New topic


Maksym Odintsov

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

Joined: Sep 13, 2007
Posts: 2229

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

I personally implement them as subclass of Exception.

It is sorta covered in the JavaRanch Style Guide.
subject: RecordNotFoundException
Similar Threads
NX: URLy Bird 1.3.1 Explicit Fatal Exception Handling
NX: DBAccess and RemoteException
GuiController design
RMI and Adapter Pattern for URLyBird
DBMain method need throw RemoteException?