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 DB file -Data section. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply 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: 473
Hi, James. I used the following code to read in a record:


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

Anton Golovin<br /><i>anton.golovin@gmail.com</i><br />SCJP, SCJD, SCBCD, SCWCD
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 303
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 ?


 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: DB file -Data section.
 
Similar Threads
Database file wrong, what should I do ?
Version 2.1.2 Bodgitt and Scarper
NX: Please Help - Writting and Reading 2 byte flag
deleted flag for Contractor object
NX:URLyBird About "deleted" flag