• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SecurityException?

 
Ranch Hand
Posts: 222
Google Web Toolkit Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 175
Clojure Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I think I'll just lie down here for a second. And ponder this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic