aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Database file wrong, what should I do ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Database file wrong, what should I do ?" Watch "Database file wrong, what should I do ?" New topic
Author

Database file wrong, what should I do ?

Fernando Franzini
Ranch Hand

Joined: Jan 09, 2009
Posts: 486
    
    2

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.

Fernando Franzini - Java Blog
Carlos Morillo
Ranch Hand

Joined: Jun 06, 2009
Posts: 221

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.


SCSA, OCA, SCJP 5.0, SCJD http://www.linkedin.com/in/carlosamorillo
Fernando Franzini
Ranch Hand

Joined: Jan 09, 2009
Posts: 486
    
    2

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....
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

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...


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

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?


    The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
    Fernando Franzini
    Ranch Hand

    Joined: Jan 09, 2009
    Posts: 486
        
        2

    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

    Joined: Dec 28, 2007
    Posts: 2265
        
        3

    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

    Joined: Jan 09, 2009
    Posts: 486
        
        2

    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.
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Database file wrong, what should I do ?