This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes About RecordNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "About RecordNotFoundException" Watch "About RecordNotFoundException" New topic
Author

About RecordNotFoundException

Matheus Mendes
Ranch Hand

Joined: May 15, 2007
Posts: 66
Hi all,

On my RecordNotFoundException, may I create a new costructor that receive a boolean type that will indicate if it is a deleted record or not ?

For example, when I call the read(int recNo), it will throw a RecordNotFoundException, on my catch block I'll use one method to verify if it is a deleted record number or a number that never exists.


Example :

1 - record
2 - deleted record
3 - record
4 - EOF

When I call read( 2 ), then I'll get no Record and I will know that may still have records on the File.

The main Question is, May I create this constructor on the Exception ? Or it will cost me points?

On The assignmente Sun says : " 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. "

But doesn't say " must have ONLY " .... I understand that " Must have at least two " .... is this assumption correct?

Thanks


The Death of one is a tragedy, but the Death of a million is just a statistic. Joseph Stalin

SCJP 6.0, SCJD
Thiago Melo
Greenhorn

Joined: Dec 09, 2008
Posts: 7
Matheus,
your instructions doesn't say this too? "Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file" If yes, i guess you can't use this class for other purpose that specified early.


Thiago Melo.
SCJP 1.4, SCWCD 5
Matheus Mendes
Ranch Hand

Joined: May 15, 2007
Posts: 66
Thiago Melo wrote:Matheus,
your instructions doesn't say this too? "Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file" If yes, i guess you can't use this class for other purpose that specified early.


yes, it say it too. But it only saids that the method must Throw the exception, and doesn't say nothing about the Exception's structure.

Well somebody else had this question ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: About RecordNotFoundException
 
Similar Threads
About:My URLyBird1.3.2 Locking
Beta Question: unlock
Do i have to create new exception for my interface
URLyBird 1.2.1 - SecurityException
No definition of what is a DuplicateKeyException