Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Dawn T.Y.Lee

+ Follow
since Aug 02, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dawn T.Y.Lee

Hello every dear rancher,
I've downloaded the assignment few weeks ago.
Because I always work in web applications developing, so I'm not very fimiliar with the topics SCJD included.
I decide to attend the SCJD certificate, and really want to improve the other Java skills thru doing the SCJD assignment. The main topics in SCJD are: IO, Multithread, Networking, Swing...etc..
My question is what the proper preparation path should I do?
1. Read the assignment requests in details
2. Study IO relatives issues to process the db file
3. ...
I'm confused for few days...

Any advice is highly appreciated, thanx a lot!
[ October 12, 2005: Message edited by: Dawn T.Y.Lee ]
Many Thanks to Daniel and Frans ! I'll try it...Thank you.
Sorry for asking so strange question above...

Now I have dumped the whole data of the db file:

There's still a question ...
The condition of the "for loop" is manully calculated.
So stupid.... but How can I write in another smart way ??

Any advice will be highly appreciated,
I'm just at the begining of doing the SCJD assignment, and I have some confusion in processing the binary db file sun given.

The format of data in the database file is as follows:

Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
2 byte numeric, number of fields in each record

Schema description section.
Repeated for each field in a record:
1 byte numeric, length in bytes of field name
n bytes(defined by previous entry), field name
1 byte numeric, field length in bytes
end of repeating block

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

End of file

All numeric values are stored in the header information use the formats of the DataInputStream and DataOutputStream classes. All text values, and all fields(which are text only), contain only 8 bit characters, null terminated if less than the maxmum length for the field. The character encoding is 8 bit US ASCII.

I'm not fimilar with Java IO, but I'm helped via many relatives threads in Java Ranch(so many thanks! ). I reslove the db file with some results:

1. the Start of file and the Schema section totally occupy 54 bytes
2. each record occupies 183 bytes
3. there're 33 records in the db file

But I don't know how to go the next step to process the db file, any advice ?

Thanks a lot !
May I test my first post here?
16 years ago