File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Regarding db.db file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Regarding db.db file" Watch "Regarding db.db file" New topic
Author

Regarding db.db file

Suresh Babu Seeram
Greenhorn

Joined: Feb 04, 2002
Posts: 27
Three classes are in this package: Data, DataInfo, and FieldInfo. With the exception of three methods, noted below, these classes are complete and functional, and you have the source code for them. Any additional classes you create that are related to the database should be placed in the suncertify.db package. 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.

Above quote is from Sun's Instructions page.
When I observe db.db file , I found there are 24 records regarding flight(i.e Orgin,Destination, ..etc). From Sun's Statement "You may not modify this file".. IT is clear that I could not add any new flights to the database file db.db.
Let me know if I am wrong.
Thanks in advance.
[ June 16, 2002: Message edited by: Suresh Babu Seeram ]
[ June 16, 2002: Message edited by: Suresh Babu Seeram ]

regards,<br />Suresh<br />Sr.Systems Engineer)<p>--Sun Certified Programmer for Java 2 Platform <br />--JLPT(Level-4) Certified Professional
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Yes. You cannot add flights are add any meta data. You cannot also switch the columns. All you can change is the available seats.
Nagu Rathina
Ranch Hand

Joined: Jun 17, 2002
Posts: 31
Dear friends,
Ref : same quote of instructions.html as referred by Suresh
1. Can I add more columns to db.db file?
2. Can I have one (or two) more db files for Route_master & Flight_master and use the db.db file as booking file?
Kindly advice me. I could not understand why the db.db file is constructed in this format. If Sai Prasad is correct, then I can just add more seats or reduce the available seats count. It does not justify for a complete project, if no other operation is allowed.
Please help me
Thanks
Robin Underwood
Ranch Hand

Joined: May 01, 2002
Posts: 117
Part of the challenge of this assignment is to work with the db.db file as it is. No, we can't change the way the database is defined.
Hugo van Elk
Greenhorn

Joined: Jun 17, 2002
Posts: 15
I guess the format the file is writen to disk cannot be changed. E.g, you cannot choose to stream DataInfo's to file. But the number of records can be changed I suppose.
/Hugo.
Suresh Babu Seeram
Greenhorn

Joined: Feb 04, 2002
Posts: 27
Hi,
What I feel is
1) db.db file is Master table for Flights information.
2) We can add one or more ".db" files in our project. eg. FlightsReservationData.db, FlightCustomersData.db
Correct me If I am Wrong..

regards,
Suresh
Mike Piotrowski
Ranch Hand

Joined: Apr 24, 2002
Posts: 82
Many of you are reading too deep into the assignment. Which many of us tend to do, considering many of us are coming from developing real world apps where we have to take all this into account.
All you need to do is search for and diplay flights by a given criteria from the db.db file. Then be able to book a flight, which will essentially change the number of available seats of that flight. No need to store customer inforamtion, add new flights, or create any new .db files. Yes, thats it.
Mike
Suresh Babu Seeram
Greenhorn

Joined: Feb 04, 2002
Posts: 27
Hi Mike,
Then How do you book the flight for particular Date.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Booking a flight on a particular date is not part of the requirement. I wouldn't worry about it.
Mike Piotrowski
Ranch Hand

Joined: Apr 24, 2002
Posts: 82
As Sai said, you do not need to worry about booking for a paticular date. Just when a client books a flight, the correct number of seats are deducted from the seats available.
Suresh Babu Seeram
Greenhorn

Joined: Feb 04, 2002
Posts: 27
Hi Sai & Mike,
Thanks for your suggestions.
Ramesh kumaar
Ranch Hand

Joined: Mar 19, 2002
Posts: 146
Hi All,
I tried adding new records to db.db and i was able to do that and did this using add(String []) of Data.java. So if sun provied u to add some new flight service for future use. Adding a new field (Column)is beyond the requirement.
regards,
-rameshkumar
Nagu Rathina
Ranch Hand

Joined: Jun 17, 2002
Posts: 31
Ref:
"As Sai said, you do not need to worry about booking for a paticular date. Just when a client books a flight, the correct number of seats are deducted from the seats available" - Mike
Mike, if that is the case then just adding or subtracting the available seats is the job to do. no other work related with db. do u think this can be justified as a good product?
thanks
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4462
    
    6

If you need more reassurance that you don't need to worry about adding more .db files or track information that you think is "implied" and necessary to make the application actually useful, see Michael Ernest's comment in this thread.
Junilu
Mike Piotrowski
Ranch Hand

Joined: Apr 24, 2002
Posts: 82
Mike, if that is the case then just adding or subtracting the available seats is the job to do. no other work related with db. do u think this can be justified as a good product?

Maybe not for a real world application but for the requirements given to us I believe it does. If I had a client and that is all the functionality they wanted, then thats what I would do for them. I would explain the advantages with a better design. Just like I did in my design choices document. In the end each one of us is responsible for the decisions we make with the assignment, and document are reasons for such.
Read the comments from Michael Ernest's. Thats the sort of advice I followed. Also I havn't gotten my grade yet, uploade about a week ago and waiting. So I could be wrong, I know it wouldn't be the first time.
Mike
Nagu Rathina
Ranch Hand

Joined: Jun 17, 2002
Posts: 31
Thank u my friends. I was much confused before, now I am clear.
Thanks again
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

Junilu wrote:
If you need more reassurance that you don't need to worry about adding more .db files or track information that you think is "implied" and necessary to make the application actually useful, see Michael Ernest's comment in this thread.

It seems to me from the requirements that our design should allow using multiple databases. My requirement says that one of the command line arguments is "Data file name(s)". I put "s" in bold because I think it is telling. In my design, the server can be started as this:
java StartServer 1099 db1.db,db2.db,db3.db
That is, the server aceepts a comma separated list of database files and registers them (essentially puts the connection to them them in the HashMap). When a remote user requests a connection to a specific database, the server uses a factory to return a database instance (wrapped in the remote connection).
Eugene.
Nagu Rathina
Ranch Hand

Joined: Jun 17, 2002
Posts: 31
Mike, what is ur answer for dbfilename(s)? why "s" is there?
thanks
Mike Piotrowski
Ranch Hand

Joined: Apr 24, 2002
Posts: 82
Nagu,
Just got back from the hospital with my wife and our new baby boy, Shaun Michael. Born Saturday morning, two weeks early. He's our first and keeping us real busy, so I have not been able to get back to people much. Though I am loving every minute of it and he is doing great.
Mike, what is ur answer for dbfilename(s)? why "s" is there?

I hardcoded the database name into the server. I actually didn't give a reason in my design choices, though I probally should have, and its not a bad idea to have it as an argument the user can enter in to start the server. Not that hard to implement.
But I'm trying not to second guess myself now. Still waiting for my results. I e-mailed Sun today and they said they recieved my upload 6/12 and it was sent to the assessor on 6/19 and I should be recieving my score 4 weeks from that date. Hopefully I get my results sooner, I would really like to get the waiting over with.
Mike
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Congrats Mike on the bouncing baby boy.
I also hard coded my db.db file using System.getProperty("user.dir");
and concatenating it to "db.db"
I did not lose any points for that.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding db.db file