Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A non-relational database file

 
Gonella Jayprakash
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have downloaded the SCJD programming assignment. Just wanted to ensure I have understood correctly. This question may have been asked earlier. Just wanted to save my time. When I extracted the contents of the zip file, the data file db-1x2 is a database file. When I try to open the file through Notepad, there are some binary characters at the beginging of the file. I have the following questions:
1. Are we to access the file from the Java code, using RandomAccessFile APIs as has been discussed in the forum?
2. What application is suggested for viewing the file?
3. How to differentiate between the various records in the database file? Is it something I have to device? Or is there any thumb rule that I need to know?

thanks,
Jayprakash
 
Lucy Hummel
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jayprakash,

Yes you are right: If you use the seach button of our forum, you find answers.

  • RandomAccesFile is quite okay.
  • I do not use any special file to see what sun provided me because I wanted to use my time for programming. I hope somebody else can give you a tip.
  • My code knows how long a record is and where a record starts.



  • Br, Lucy.
     
    Muhammad Shafique
    Ranch Hand
    Posts: 59
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    1. Are we to access the file from the Java code, using RandomAccessFile APIs as has been discussed in the forum?

    RandomAccessFile is recommended.

    2. What application is suggested for viewing the file?

    It's better to write an application/routine by following the schema.

    How to differentiate between the various records in the database file? Is it something I have to device? Or is there any thumb rule that I need to know?

    Each record in data file should have eaqual length. You can use record number as unique "identifier" to distinguish records. This may not be a part of schema.



    Regards,
    Shafique
     
    Rob Cromley
    Greenhorn
    Posts: 24
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    For what it's worth, when I first got the assignment I wrote a side-program to retrieve the records from the database and put them into a format that I could work with better (in my case, simple comma delimitations between the fields and a line feed for each record made it easy to import into Excel). Later on this program will be great because it will let you check the database easily and verify that your updates and such are working correctly.
     
    chris bajada
    Ranch Hand
    Posts: 41
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    To view the dbfile i use hexeditor XVI32 - its freeware and gives you a nice view of the magic cookie, db header, deleted flags, different record fields etc

    gd luck
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic