This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes delete operation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "delete operation" Watch "delete operation" New topic
Author

delete operation

K Madan
Greenhorn

Joined: Apr 08, 2004
Posts: 10
// Deletes a record, making the record number and associated disk
// storage available for reuse.

// Throws SecurityException if the record is locked with a cookie
// other than lockCookie.
public void deleteRecord(long recNo, long lockCookie)
throws RecordNotFoundException, SecurityException;

Data section.
Repeat to end of file: 1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record

This text is from B&S assgnment can anyone please explain what does delete operation actually does :-
1. sets a (delete)byte to 1 in the file for the record
2. removes it from the file (as in the interface doc it says
associated disk storage available for reuse.

anyone knows this?
thanks
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi,
I means that the record should be marked as deleted, and in future add operation you can use the same space to enter the new record.
Basically, it says that when you add a new record, you should find a deleted record first then overwirte it.


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
K Madan
Greenhorn

Joined: Apr 08, 2004
Posts: 10
Thanks Hanna
it makes sense now !
cheers
-Km
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: delete operation
 
Similar Threads
update, delete & create implementation
delete method
RecordNotFoundException and unlock
Reusing the record number
Urlybird 1.1.1 delete method