• 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

client and database URLyBird

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Server has to read and update the databasefile.db Client in this case must make a network connection to the server. In this case the databasefile.db sits on the server machine.

Client must also be able to do it but without a network connection.

Where is this databasefile.db supposed to sit? On the server machine or on the client machine?

Maybe I am to assume that the server AND the client are both on the same machine. Thus, the databasefile.db is on that machine too?

Client cannot locally connect to the databasefile.db is that file is on another machine.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The jar that you end up shipping contains both client and server code. Then depending on what mode the jar is run in it will look for the database file. So in the case of client and server on two physically seperate machines the client is run in client mode and does not look for the file, the server is run in server mode and looks for the file. In the case of standalone mode the client is on the same physical machine as the database file and it finds it.
 
Robert Aragon
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Machine A contains the database.
Machine A contains the client.
Machine B contains the server.

When run in server mode, not local mode by the client, the server has to
make a network connection to Machine A. Right?

When run in client mode, locally where the client makes NO network connection
to the server, the client connects to the database on the same machine it is
on. Right?

It just seemed strange that the client has to make a network connection to the server, but then the server makes a connection to the machine the client is on because the database is on that same machine. Right?
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Robert,

I think you are trying to cater for a non-existant problem. Consider the following scenario
  • Machine A has database
  • Machine A has runme.jar
  • Machine B has runme.jar


  • Machine B does not have direct access to the database (that is, there are no drive mappings (for Microsoft) or remote network mounts (for Unix and unix like systems).

    In that situation, we could have:
  • Machine A running java -jar runme.jar alone (to run as a standalone client


  • Or:
  • Machine A running java -jar runme.jar server in one JVM (to run as a server). In this case we have two other options:
  • Machine A running java -jar runme.jar in another JVM running as a networked client connecting to the server on Machine A
  • Machine B running java -jar runme.jar running as a networked client connecting to the server on Machine A

  • However we cannot have Machine B running java -jar runme.jar server since the database is not local. Trying to get this scenario to work is (in my opinion) beyond the scope of the assignment.

    Regards, Andrew
    [ July 27, 2005: Message edited by: Andrew Monkhouse ]
     
    Robert Aragon
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    O.K. So for the sake of this assignment, everything can be put on the same machine?

    I guess everyone who has turned in their assignment and passed, has done so so that it works on ONE machine. server, client, and database are all on the same machine, right? Whew.

    These three commands are ALL on the same machine, right?

    java -jar file.jar server
    java -jar file.jar

    java -jar file.jar alone
     
    Ranch Hand
    Posts: 357
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Robert Aragon:
    I guess everyone who has turned in their assignment and passed, has done so so that it works on ONE machine. server, client, and database are all on the same machine, right? Whew.


    Hi Robert,

    It should work on one machine and of course during my development that is how I tested it.
    However, it must also work when client and server are on different machines and it is very important that you test that that works, because if it doesn't work, you will probably fail the assignment.

    Frans.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic