Hi all, 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. Thanks
------------------ Jane Griscti Sun Certified Programmer for the Java� 2 Platform [This message has been edited by Jane Griscti (edited July 20, 2001).]
I've the same instruction. According to my instruction, I don't need to bother with the total seats. I just need to know the no. of seats available at this instant, and that is stored as the last element of every string of record in the member RAF db of the Data object.
I don't think they meant that when someone books a flight you can't modify the db.db file. I think what they meant was that you can't alter the structure of it. 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.
posted 19 years ago
I believe 'may not modify' just means you've to upload it in its original status exactly as the time you downloaded it. So, after you played around with it you still have to replace it with the original one before uploading. 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??
posted 19 years ago
Originally I thought they were just refering to the db.db structure, as Kevin said, what's the use of a db that can't be modified or updated. Then I saw the Data class had two ctors, 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"?? Thanks Jane
hi jane 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 thanx shail
posted 19 years ago
Yes it says "may not modify" 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.