• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Cookie value

 
Maria Lepschy
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have downloaded my assignment yesterday. It is the contractor. Now I have many questions:
1.I was surprized that there is a database file. How is the connection with the database? That means, a database working will be simulated and we have to read, delete or updates rows to this file?
2.Where can I find the cookie value? My file is db-2x3.db. Can be that the cookie value is 0023(it must have 4 byte length)?
3.I have just received the Max Book and I tried to compile and run the sampleproject. I have written the main class in a manifest file exactly how in the book is described. I don't know why in my new generated jar file instead of my manifest, the default manifest (without the main class) is existing.
Many thanks,
Maria
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maria,
Originally posted by Maria Lepschy:
1.I was surprized that there is a database file. How is the connection with the database? That means, a database working will be simulated and we have to read, delete or updates rows to this file?
That's right, BUT FIRST MAKE A BACKUP COPY OF THE db-2x3.db AND STORE IN A SAFE PLACE. You will be including a copy of the db-2x3.db file with your submission and it's supposed to be the virgin version.
2.Where can I find the cookie value? My file is db-2x3.db. Can be that the cookie value is 0023(it must have 4 byte length)?
If you're talking about the magic cookie value (the one that identifies whether the current file is in the proper format for a database file), then you should be able to find it where the database schema section of your assignment instructions tell you it is. You can read in this value the same way you read in any of the other database values.
3.I have just received the Max Book and I tried to compile and run the sampleproject. I have written the main class in a manifest file exactly how in the book is described. I don't know why in my new generated jar file instead of my manifest, the default manifest (without the main class) is existing.
There's a known bug with how the jar command processes the manifest file: the jar command seems to require that there be a blank line at the end of the manifest file. Without this (extra) blank line, the jar command doesn't seem to parse the manifest file correctly.

Hope this helps,
George
[ January 26, 2004: Message edited by: George Marinkovich ]
 
Maria Lepschy
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks, George.
Only the cookie value is now a "problem"- I can't find it. I read the instructions. The section Database schema contains only field name and description, but nothing about cookie.
My Data File Format section has the folowing text:
Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
2 byte numeric, number of fields in each record
etc
Nothing about a location where the cookie value can be.
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maria,
But you DID find it. That's it right there:

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

The first 4 bytes of the database file comprise the magic cookie value. The next 2 bytes of the database file compise the number of fields in each record, etc.
Sometimes it's hard to see the forest for all the trees. But sometimes, we run into one of the trees and then we're so close to it we can't tell it's a tree.
Hope this helps,
George
 
Maria Lepschy
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, George, it is too easy.
Many thanks, nice that you have so quickly answer, for me a great help.
Regards,
Maria
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic