This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes DB file -Data section. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "DB file -Data section." Watch "DB file -Data section." New topic
Author

DB file -Data section.

James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
My assignment states UrlBird.
Data section.
Repeat to end of file:
1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record


When I read the field the byte is BLANK! do I need to set this to 0?

here is my code to read in that 1 byte.


Output



Thanks!
Anton Golovin
Ranch Hand

Joined: Jul 02, 2004
Posts: 476
Hi, James. I used the following code to read in a record:


[ November 11, 2004: Message edited by: Anton Golovin ]

Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
Prior to reading the complete record checking whether the record is already deleted or not is better.

If the flag is not valid you don't have to set it to the right one( if the requirement is not saying so). In my asignment flag can be changed during insert or delete.
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
Anton
ASCII-US doesn't work. Are you sure its not US-ASCII ?


 
GeeCON Prague 2014
 
subject: DB file -Data section.