Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

delete method in B & S

 
mohini lalwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I am deleting record then

database.writeByte(0xFF);

where
database is instance of RandomAccessFile


and when I looked at .db file
I found this character begining of record which i deleted using deleted (recNo)



is it okay ??
because in sun instruction written

"1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record "


let me know
 
Oyvind Gjare
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pramod,

are you using a hex editor (like ultraedit) to look at the file?

Oyvind
 
mohini lalwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using TextPad to read the file .
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the database file is not as simple as plain text file. To read it correctly, you have to point the RandomAccessFile pointer to the location of that byte and use its readByte() method.


Good Luck !!!

Jeffry Kristianto Yanuar (Java Instructor)
SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic