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 Deleting/adding  records. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Deleting/adding  records." Watch "Deleting/adding  records." New topic
Author

Deleting/adding records.

Peter Kovgan
Ranch Hand

Joined: Sep 18, 2003
Posts: 84
From Bodgitt and Scarper:
"...Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file.... "
And no word more about deleting or adding records.
Should I allow to user add/delete records?
Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
Hi,
The user? Who is the user? If the user is a server, yes; if the user is a client, no.
Best,
Damu
Peter Kovgan
Ranch Hand

Joined: Sep 18, 2003
Posts: 84
Please, explain me:
What I should do, separate "server administration" to delete/add records?
Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
1. the server have the right to add/delete a record.
2. a deleted record has a special flag at the beginning of the record. From the instruction.:
2 byte flag. 00 implies valid record, 0x8000 implies deleted record
So if you find that the record is deleted or doesn't exist at all, you throw the exception.
3. you implement the add/delete methods in Data class.
4. you may never use these methods unless you decide to provide the functions beyond the instruction of suncertify
Peter Kovgan
Ranch Hand

Joined: Sep 18, 2003
Posts: 84
Thank you very much,Damu Liu!
I understand .
Can you help me with one question:
How to hide public methods of Data.class(lock(),unlock()) from client?
I want to keep encapsulation and allow access to these methods only from
another methods(bookRecord() for example).
I feel - answer is simple, but have no idea.
Extend Data.class by another class and call super.lock()?
[ October 26, 2003: Message edited by: Peter Kovgan ]
Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
Hi please see this topic endless discuss
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deleting/adding records.