File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes SecurityException? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "SecurityException? " Watch "SecurityException? " New topic
Author

SecurityException?

Elchin Asgarli
Ranch Hand

Joined: Mar 08, 2010
Posts: 222

My DB interface I received by the assignment is as follows:



and then I have methods that throw RecordNotFoundException and SecurityException. And then following statement in the instructions :

Any unimplemented exceptions in this interface must all be created as member classes of the suncertify.db package. Each must have a zero argument constructor and a second constructor that takes a String that serves as the exception's description.

So do I need to create SecurityException on my own or do I assume that is it java.lang.SecurityException ?

And by the way I assume that RecordNotFoundException is a checked exception, am I right?


Personal page, SCJP 6 with 91%, SCWCD 5 with 84%, OCMJD
David Byron
Rancher

Joined: Jan 20, 2009
Posts: 169

Elchin Asgarli wrote:...must all be created as member classes of the suncertify.db package....

So do I need to create SecurityException on my own or do I assume that is it java.lang.SecurityException ?

Since java.lang.SecurityException is not a member class of the suncertify.db package, it looks as if you'll have to create your own.

And by the way I assume that RecordNotFoundException is a checked exception, am I right?

Seems like a safe assumption.


SCJD 6, Baroque Potion, G+
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4910
    
  10

I would create my own SecurityException. And my RecordNotFoundException was a checked exception, but I know other ones used a runtime exception instead.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Raf Szczypiorski
Ranch Hand

Joined: Aug 21, 2008
Posts: 383
I created my own SecurityException and justified this by saying that even though java.lang.SecurityException exists, it is thrown when internal Java security policies are violated, and my custom exception is a domain exception specific to the project.
 
 
subject: SecurityException?
 
Similar Threads
about unimplemented exceptions
B&S: Unimplemented exceptions
URLyBird 1.2.3 Unnecessary locking?
No definition of what is a DuplicateKeyException
Should lock methods be callable by the client