• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Structure of the DB file, what is to be stored

 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am looking the DB spec in the assignment.
It says that the DB is structured in the following manner.
-magicnumber, zerorecord,fields
-n timesfieldnamesize,fieldname,fieldlength
-data

in data, it specifies, fixed length strings. Say the name is 64 bytes. Does the file need to have all 64 characters filled. If the name is "hilton", what do we do with the remaining 58 charcters left blank.

Help is required.
Regards
Aruneesh
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried to print out your data file contents? For my UrlyBird assignment, the remaining characters are all whitespaces. So I'd follow the convention of the data file.
 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you writing to the DB file.
I am unclear as to what the format of the file is supposed to be.
The magic number, header are all written using DataOutputStream, which is like binary.

Rest all the data is all written in US-ASCII, which means in the file it should appear as clear-text.
If above is not correct, do let me know what is to be done.

If above is correct, what is the approach we need to take.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aruneesh,

Have you written a small program to read the data file? Some of your questions may be answered if you see what is currently in place.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic