• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

delete method of B&S

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In my delete method I am

doing like this .
database.writeBytes("1");

becasue in instruction written
1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record

please tell me is it okay ???
 
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I prefer use writeBytes() method that use int as the parameter. Either way, just make sure that it works the way you want.

In my assignment, the delete flag is short, so I use writeShort() method to mark the record as deleted.

Good Luck !!!


Jeffry Kristianto Yanuar (Java Instructor) SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2)
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should not use the writeBytes(String) version, as character '1' is not the same thing as integer 1 (the value of '1' is in fact 49).
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
Are you sure that 1 is the right value for a deleted record ?
In the spec we can read :

0xFF implies deleted record

, yet 0xFF = -1 ...
(I'm currently working on UB-1.3.3)

Chris
 
christian combarel
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for my previous post, I've just seen it's about B&S and not URLyBird !
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by christian combarel:
Sorry for my previous post, I've just seen it's about B&S and not URLyBird !



Different version of URLyBird also has different delete flag. That's why I always included my version of URLyBird when I open the thread.


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