• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Junk Characters displayed after setting Delete flag - Bodgitt & Scarper 2.2.3

 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am back after a long time . I have started implementing delete method which has been defined by Sun Interface. My interface comments are
1 byte flag. 00 implies valid record, 0xFF implies deleted record . As per spec, I have written 255 i.e FF in the db file successfully while deleting the particular record. I found the following bold character

ÿBitter Homes & Gardens in the file after deletion . Any idea?


sat
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe a code snippet of the code you use to delete the reocrd (and write the delete flag) would be helpful
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
satishkumar janakiraman wrote:I found the following bold character

ÿBitter Homes & Gardens in the file after deletion . Any idea?


Partner, what did you use to read the .db file? A normal text editor?
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel and Roberto,

I appreciate your response. Here is the sample code,


Here fileHandler indicates the RandomAccess File,
loc indicates the delete flag position in the db file.
and deleteFlag indicates the integer value 255.

I used a free hexeditor not a text editor.

sat

 
Greg Mandel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, that is the deleted flag (oxFF) isn't it? I mean, when you read it back, you are casting the value to a char and writing it to the screen.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Satishkumar!

Partner, were you able to find your problem? I created a simple tool that reads the database file (you can find it here). Try using it to see if you really have something weird in your .db file.
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Greg,

Yes it is a delete flag. I am able to set/get the value 255 to/from db. Please look at the attachment, I see a junk value in front of Bitter Homes & Gardens. I would like to confirm whether this is correct or incorrect

Hi Roberto,

Thanks for providing me a link to your tool. Please have a look at the attachment. DB has a junk character in front of Bitter Homes & Gardens. I am not sure whether this is correct


sat
Delete_Flag in DB.jpg
[Thumbnail for Delete_Flag in DB.jpg]
Junk Characters in db after setting delete flag
 
Greg Mandel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just check the database design section in the instructions, it explains the format of the data.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic