• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding db.db file

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. You cannot add flights are add any meta data. You cannot also switch the columns. All you can change is the available seats.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike,
Then How do you book the flight for particular Date.
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Booking a flight on a particular date is not part of the requirement. I wouldn't worry about it.
 
Mike Piotrowski
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sai & Mike,
Thanks for your suggestions.
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank u my friends. I was much confused before, now I am clear.
Thanks again
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike, what is ur answer for dbfilename(s)? why "s" is there?
thanks
 
Mike Piotrowski
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic