Decided to knuckle down and work on the SCJD assignment. In reading the various posts I notice most of you mention modifying db.db. My instructions say:
"The suncertify/db directory in this distribution also contains your database file, "db.db". You may not modify this file, but you may move it if you wish."
Did anyone else have a similar instruction?
I've been thinking that I'll have to implement a separate db that gets loaded with the flight info and then modify that or create a separate object that stores the total seats and booked seats and save it when the server closes.
Any advice would be appreciated.
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by Jane Griscti (edited July 20, 2001).]
If you couldn't modify it, then you would have to write all of the seat information to another file. I haven't read any discussions of anyone doing it that way.
My .02, and I passed.
It's very likely that different candidates may get different versions of db schema or records so Sun have to check against it. Or Sun has written certain testing routines to assess your assignment and that have to be applied on the original record to obtain expected results. If you add some junk records, it's likely their testing would fail! - No, that means you'll fail!
If a database cannot be modified and updated, what is its practical purpose??
Data(String dbname) to open an existing file.
Data(String dbname, FieldInfo fields) to create a new db file.
So I thought maybe they expect me to create and use another db. Plus the instructions for command line args list "Data file name(s)" as valid, implying more than one db can be used.
Rick, Were your instructions worded the same way "may not modify"??
1. I feel the second constructor is for "future use" - just in case you want to add new tables like linking to customer data or the payment for the ticket etc.
2. by the command line argument for DB file - they might mean the location of the file - " they say you can move it ".
3. my instructions also say that " you may not modify this file "
I am also struggling with the FBN assignment - pls shed more light on this db.db issue
I believe that in order to understand some of the strange things about Data one must understand the history of the assignment. In previous versions, candidates were asked to create a tool that would create the database and migrate files from text to the binary file. So that is what the second constructor is for.
Also that is why the writeRecord and delete methods are there. the conversion tool had to insert new records, and during this course if any error occurred, they were required to rollback the database to what it was before import began. So they would have to use the delete method to do the rollback.
I hope that this puts it in a better perspective.