Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

should there be 2 "db.db" files

 
dinesh pande
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the Fly By Night assignment where i am supposed to have a network data server and also a provision to work in offline mode.
I was a little confused with this. Should we be having 2 "db.db" files. One on the server and one on the client?
Could someone please help me understand this.
Thanks
[ May 21, 2003: Message edited by: dinesh pande ]
[ May 21, 2003: Message edited by: dinesh pande ]
[ May 21, 2003: Message edited by: dinesh pande ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11914
207
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dinesh,
No, there is only one db.db file. The local client and the server will both refer to the same file (but not at the same time).
In all probabilty the examiner will run your local application, your remote application, and your server application in the same directory, however the requirements do say that they should work no matter what directory they are installed into, so dont rely on how I think the examiner will run the applications.
If you wanted to think of this in terms of a real life scenario, imagine that the client is worried about network outages. So, normally everyone would work via the networked version. But if there was an outage, then the person whose computer houses the server and the db.db file can then run it in local mode.
Regards, Andrew
[ May 21, 2003: Message edited by: Andrew Monkhouse ]
[ May 21, 2003: Message edited by: Andrew Monkhouse ]
 
dinesh pande
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andrew Monkhouse:
In all probabilty the examiner will run your local application, your remote application, and your server application in the same directory (although the requirements do say that they should work no matter what directory they are installed into, so dont rely on that).

Please help me understand if we really dont have to rely on the requirements and make assumptions that examiners will be testing in a particular way ?
Thanks
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11914
207
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dinesh,
Sorry, my bad. Typo changed my meaning.
I meant do not rely on the probability that the examiners will run all your applications in the one directory.
Always follow the requirements in your spec.
Regards, Andrew
 
dinesh pande
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for trying to answer patiently.
However my question still remains a question. Now that you have clarified we can't make any assumptions, it could be possible that client and server are in sepearte directories , may be on seperate machines.
So do'nt we need 2 db.db files in such a case, one for the clinet and one for the server?
Thanks
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So do'nt we need 2 db.db files in such a case, one for the clinet and one for the server?
Nope, you only need one. You should jar up both client and server and probably should locate db.db in the same directory with your client and server jar files embedded in your submission jar. You should also note the location of db.db in your README.txt file. You can do as I did and provide an optional command line parameter that indicates the path of db.db. In my case, if the optional parameter was not used, both client and server attempted to open db.db in the current directory (of course that is client running in local mode).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic