• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SecurityException?

 
Elchin Asgarli
Ranch Hand
Posts: 222
Chrome Eclipse IDE Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
David Byron
Rancher
Posts: 175
Clojure Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Roel De Nijs
Sheriff
Posts: 10202
129
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would create my own SecurityException. And my RecordNotFoundException was a checked exception, but I know other ones used a runtime exception instead.
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic