| Author |
Structure of the DB file, what is to be stored
|
Aruneesh Salhotra
Ranch Hand
Joined: May 12, 2004
Posts: 167
|
|
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
Joined: Apr 02, 2004
Posts: 884
|
|
|
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.
|
SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
|
 |
Aruneesh Salhotra
Ranch Hand
Joined: May 12, 2004
Posts: 167
|
|
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
Joined: Mar 28, 2003
Posts: 10816
|
|
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
|
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
|
 |
 |
|
|
subject: Structure of the DB file, what is to be stored
|
|
|