This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX:URLyBird About Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX:URLyBird About "deleted" flag" Watch "NX:URLyBird About "deleted" flag" New topic
Author

NX:URLyBird About "deleted" flag

Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
My assignment said in my data section of database file have 1 byte "deleted" flag. 0 implies valid record. 1 implies deleted record. Whether this means the record isn't deleted , in fact , when the user delete it , only set it's "deleted" flag 1, but this record exist yet!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Yes, the record in reality still exists in the db.db file, however the space should be reclaimed by any new record. And no you do not need to implement a GUI to add records, just the method in the Data class.
So marking it deleted is all it has to do. It is similar to some databases, like for example in Foxpro you can mark records for deletion and they remain in the database. When you get the database exclusive and send a "Pack" command, then it actually deletes the data from the file.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
Hi, Mark:
And no you do not need to implement a GUI to add records, just the method in the Data class.

Whether you mean the records' quantity on the data file is absolute, cann't increase or reduce it?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
The GUI does not need to be able to add or delete records. However the Data class is required to have methods that could add or delete records - the GUI just never calls them.


"I'm not back." - Bill Harding, Twister
 
Don't get me started about those stupid light bulbs.
 
subject: NX:URLyBird About "deleted" flag