wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: db location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX: db location" Watch "NX: db location" New topic
Author

NX: db location

S. Ganapathy
Ranch Hand

Joined: Mar 26, 2003
Posts: 194
Hi there,
I have some problem in the specification. It says:

Non-networked mode:
------------------
this mode must use the database and GUI from networked form
Networked mode:
--------------
You may use rmi or serialized objects.
In either case, the program must allow the user to specify the location of the database,
and it must also accept an indication that a local database is to be used,
in which case, the networking must be bypassed entirely.
Running the application:
-----------------------
java -jar <jar_file_name> [<mode>]
mode : server - server program will run
alone - standalone mode
and leftout entirely, network client and gui must run

Here I got confused.If I run the program in server mode, and then if I run the program again for gui client and chose db location, how will the server identify and run with that database. As the server runs on some pre defined db, or in worst case, if one client chose one location of database, and the other client chose another location for database, for the same server, how to resolve the issue.
Can any body please help me.
Thanks in advance.
Ganapathy
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I think you can read "location of the database" as being "location of the database server".
-Barry


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
S. Ganapathy
Ranch Hand

Joined: Mar 26, 2003
Posts: 194
Hi Barry,
What will be the probable location of the database. I mean it will be free text. User may type-in machine name/ip address. How do the program know whether it is local machine, or remote machine. In case of local machine, it should work as standalone.
Can you please clarify me?
Ganapathy
frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
Originally posted by S. Ganapathy:
Hi there,
I have some problem in the specification. It says:

Here I got confused.If I run the program in server mode, and then if I run the program again for gui client and chose db location, how will the server identify and run with that database. As the server runs on some pre defined db, or in worst case, if one client chose one location of database, and the other client chose another location for database, for the same server, how to resolve the issue.
Can any body please help me.
Thanks in advance.
Ganapathy

The database file location is apprant to the client, you could disable the user to modify this item. only the server and standalone mode concern the database file location.
Frank
S. Ganapathy
Ranch Hand

Joined: Mar 26, 2003
Posts: 194
Hi frank sun,

Networked mode:
--------------
You may use rmi or serialized objects.
In either case, the program must allow the user to specify the location of the database,
and it must also accept an indication that a local database is to be used,
in which case, the networking must be bypassed entirely.

The above is more worrying me. That means, GUI must allow the user to select the database location. But how to pass this databse location to the server, if the server is already up and running? This is more worrying to me. And moreover, "It also accept the indication that a local database is to be used, in which case, the network client must be bypasses". How do the program know whether the selected location is on the same machine, or on the remote machine?
I am glad if any body clarrify this point.
Thanks in advance.
Ganapathy
frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
Originally posted by S. Ganapathy:
Hi frank sun,

The above is more worrying me. That means, GUI must allow the user to select the database location. But how to pass this databse location to the server, if the server is already up and running? This is more worrying to me. And moreover, "It also accept the indication that a local database is to be used, in which case, the network client must be bypasses". How do the program know whether the selected location is on the same machine, or on the remote machine?
I am glad if any body clarrify this point.
Thanks in advance.
Ganapathy

1.assuming these 3 running modes running in 3 different location
2.server needs to set up its host, port and data file location
3.client needs only to setup the host and port it wants to connect, it does not care where the data file is.
4.standalone mode just needs only to concern the data file.
5.the configuration parameters stored in a file suncertify.properties, which located in the app's root directory
6. as the instruction says, we can only run the app using this approach:
java -jar runme.jar [server|alone ]
Hope that help.
Frank
S. Ganapathy
Ranch Hand

Joined: Mar 26, 2003
Posts: 194
Hi frank sun,
Now it is very clear for me.
location of the database is the location of the Data object throught which the application "read-write" the data file. This is selected using file chooser. Its main purpose is just read the host name, and rest of the parameters are ignored.
Thanks a lot.
Ganapathy
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1297
I still dont totally get it
what exactly does stand alone mean?


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi Billy,
Stand alone means that the application must be able to run without any network, and without running more than one application.
If you need to run a server and a client, then the client is not stand alone - there is an additional application.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1297
so standalone basically is non-networked mode(local connection) right?
where no networked server codes are used at all
???
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi Billy,
so standalone basically is non-networked mode(local connection) right?
Yep - exactly right.
Regards, Andrew
 
Don't get me started about those stupid light bulbs.
 
subject: NX: db location
 
Similar Threads
Some Ambiguity
Don't understand mode flag
NX: About the db file
How many modes are there for the program?
db location