• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: 1.4.2 URLyBird: Very Lost

 
L Durrell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My name is David. I passed the SCJP for 1.4 on 10 September. Thinking that I could learn the material I needed to pass the exam, I bought the SCJD exam the same day. It appears to be more overwhelming than I expected.
I do not fully understand the generalities of "Non-Networked Mode." Does each computer have to be able to work with its own database or will only the server client still operate in this mode? I suspect the latter because the former makes no sense, but you never know...
I don�t understand how the data file should be structured. What is a magic cookie value? What is the �offset to start of record zero� and �offset to file�?
How can multiple rooms with the same characteristics be represented in the database? Is it legal to insert multiple, identical records into the data file?
David
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,
I do not fully understand the generalities of "Non-Networked Mode." Does each computer have to be able to work with its own database or will only the server client still operate in this mode? I suspect the latter because the former makes no sense, but you never know...

It might help you to think like this:
When the company first receives your software, one person will use it in single user mode (non networked mode) for a while. No other person will be able to use the system.
When that person is satisfied that your program does what it is meant to do, the company will start running your server, and multiple clients will start running in networked mode. While running in networked mode, nobody will connect in non networked mode.
I have seen this happen in small business.
I don't understand how the data file should be structured. What is a magic cookie value?

Try doing a search in this forum for "magic cookie". Even if you only search for topics with the word "magic cookie" in the heading you will still find several topics to read. Here's one of them.
By the way, there are few differences between the "URLyBird" and "Bodgit & Scarper" assignments, so if you see a response under the heading Contractors read it anyway - chances are it will still apply for you.
What is the "offset to start of record zero" and "offset to file"?

Where did you get thse terms from? I cannot comment on the second one, because I don't understand it.
Your offset to record zero is something you will have to calculate yourself, based on the data file you received. Other people may have received different data files (even if they are also doing URLyBird they may have different data files than you).
Your instructions tell you how the file is structured. Typically it describes the initial header data which usually includes a field detailing how many columns are in the database. You then have to read the database meta data using the provided details of it's format. Once you have completely read the meta data, you will be at the offset to record zero. The meta data will provide the information on how long each record will be.
How can multiple rooms with the same characteristics be represented in the database? Is it legal to insert multiple, identical records into the data file?

You need to look at your meta data to find out whether there are any unique keys or not.
I think you have to implement an interface, which probably has a method for adding records to the database. Does this method throw any exceptions? If so, you might want to do a search in this forum for that exception name, to see what other's here have thought about this.
Regards, Andrew
[ September 20, 2003: Message edited by: Andrew Monkhouse ]
 
L Durrell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, thank you for your help.
I took another look at my jar file�s contents. It has three files: an empty manifest file, the instructions file, and a database file (db-1x2.db) that I cannot open using �NetBeans IDE 3.5.1�.
Quote:
*********************
What is the "offset to start of record zero" and "offset to file"?
Where did you get these terms from? I cannot comment on the second one, because I don't understand it.
**********************
Quoting the instructions: �Data section. (offset into file equal to �offset to start of record zero� value)�
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,
a database file (db-1x2.db) that I cannot open using �NetBeans IDE 3.5.1�.

Correct - the database file is in a proprietary format designed by Sun especially for this asignment. It does not match any commercial database (that I know of) and it doesnt even match the databases used by other people doing different versions of the URLyBird assignment.
By the way - you should be careful to ensure that you only submit code you developed. If NetBeans auto generates code for you (for example in your GUIs) then you should not submit that code.
Thanks for giving the "offset" statement.
The database consists of three sections:
  • the first section contains the magic cookie and details needed for reading the schema
  • the second section contains the schema
  • the third section contains the data


  • So the offset statement is just specifying that the data section begins with record 0. I described above how you will have to calculate where that is.
    Regards, Andrew
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic