This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Field Name and Field Length Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Field Name and Field Length" Watch "Field Name and Field Length" New topic
Author

Field Name and Field Length

John Mhenry
Greenhorn

Joined: Mar 15, 2013
Posts: 9
There are two, two byte sections in the Schema that have every field encapsulated in a 'field name' and a 'field length'.
When I look at 'Denny's Dvd' source it appears like these are not referenced anywhere.

Denny's Dvd class has a final 'RECORD_LENGTH' which has no 'field name' or 'field length' separators.
Is Denny's DVD database completely different than the test?
Roel De Nijs
Sheriff

Joined: Jul 19, 2004
Posts: 7061
    
  28

There are difference between the database of Denny's DVD and the one used in the actual assignment. There are even differences in database schema and interface methods between the different versions of an assignment.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
OCAJP 7
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 1018
    
    4
John Mhenry wrote:There are two, two byte sections in the Schema that have every field encapsulated in a 'field name' and a 'field length'.
When I look at 'Denny's Dvd' source it appears like these are not referenced anywhere.

Denny's Dvd class has a final 'RECORD_LENGTH' which has no 'field name' or 'field length' separators.
Is Denny's DVD database completely different than the test?


Denny's Dvd records start from location 0 in the database file.
But in my assignment , the first 70 bytes are for the meta data:
4 bytes for magic cookie (location 0-3)
4 bytes for offset (location 4-7)
4 bytes for number of fields
2 bytes for field length
4 bytes for name
4 bytes for location .....

The record starts from location 70.
Try to read your database file from location 0 and see what it prints out.
 
wood burning stoves
 
subject: Field Name and Field Length
 
jQuery in Action, 3rd edition