Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Database file wrong, what should I do ?

 
Ranch Hand
Posts: 489
2
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers
I realized that my database file provided by assignment zip is wrong !!!
My assignment say:

......
Data section.
Repeat to end of file:
1 byte flag. 00 implies valid record, 0xFF implies deleted record
Record containing fields in order specified in schema section, no separators between fields, each field fixed length at maximum specified in schema information
.....


This missing a byte (00 or 0xFF) at the end of the last record.
Someone can chek for me ?
So what should I do ? Just put this missing byte and submit my project or do I send an email complaining about it ?
Regards.
 
Ranch Hand
Posts: 221
Scala Python Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't quite clearly understand your message but just in case, if you are reading a single byte for the Valid Status of a record you need to use readUnsignedByte() since 0xFF is 255 as an int and the maximum value of a signed byte is 127.

Hope this helps,


Carlos.
 
Fernando Franzini
Ranch Hand
Posts: 489
2
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Carlos
Thanks for sugestions...it dont help.
I open the file in Hex editor and is missing the last byte -> 00 or 0xFF !!!
What I mean is....in the end of each record must have a byte 00 or 0xFF and...in the last record DONT HAVEEEE !!!
I think i'll send an email to SUN reporting it....
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fala Fernando!

Champion, did you try reading it with the DBFileReader tool?

Which one is your assignment?

So what should I do ? Just put this missing bit and submit my project or do I send an email complaining about it ?



Hum... no. You have to send the same file that was downloaded by you when you got your project. Anyway, if you really think that your .db file has some problem, you can send an email to who2contact@sun.com. But it is really weird...
 
author and jackaroo
Posts: 12199
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fernando

My reading of your post:
  • According to your instructions the delete flag comes before each record.
  • According to your post you are looking for a delete flag after each record.


  • Am I reading your post incorrectly?
     
    Fernando Franzini
    Ranch Hand
    Posts: 489
    2
    Spring Java Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Andrew
    I'm lost now lolll.....
    My instructrions say:

    Data section.
    Repeat to end of file:
    1 byte flag. 00 implies valid record, 0xFF implies deleted record


    in the end meaning=after each reacord...
    Am I wrong ?
     
    Roberto Perillo
    Bartender
    Posts: 2292
    3
    Eclipse IDE Spring Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Oh, right. The thing is, this flag does not appear in the end of the record, it appears just before the record. The Data section repeats until the end of file.
     
    Fernando Franzini
    Ranch Hand
    Posts: 489
    2
    Spring Java Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yeahhh Roberto !!
    You are right !!! The delete byte indicator is before record !!!
    I realy misunderstood !!!
    Sorry about false alarm lollllll
    Thanks again for help.
    Regards.
     
    Tell me how it all turns out. Here is a tiny ad:
    Thread Boost feature
    https://coderanch.com/t/674455/Thread-Boost-feature
      Bookmark Topic Watch Topic
    • New Topic