This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Field Name and Field Length

 
John Mhenry
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9828
103
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Himai Minh
Ranch Hand
Posts: 1229
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic