This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

B& S DB unlock method signature  RSS feed

 
Rod Abreu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't understand why the unlock method must throw RecordNotFoundException.
My unlock signature looks like this:
public void unlock(int recNo, long cookie) throws RecordNotFoundException,
SecurityException;

Can someone help on this issue?

Tks,
Rod.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you see no reason to ever throw it then don't...
It's there for if you want it. You might for example check whether a record exists before trying to unlock it (mind I don't advise you do, it makes some things a lot more complex).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!