my dog learned polymorphism*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes about the Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "about the "server" instructions" Watch "about the "server" instructions" New topic
Author

about the "server" instructions

Arun Kumar
Ranch Hand

Joined: Aug 29, 2003
Posts: 67
In the instructions given to me Under the topic "Server"
<instruction>
Required Interface
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:
[then they list the DBAccess interface]
Any unimplemented exceptions in this interface must all be created as member classes of the suncertify.db package. Each must have a zero argument constructor and a second constructor that takes a String that serves as the exception's description.
Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file.
Network Approaches
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. 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. No authentication is required for database access.
</instruction>
"In either case, the program must allow the user to specify the location of the database" - I interpret it as, in RMI mode or Sockets mode, the server program (that is "java -jar runme.jar server") should allow the user to choose the DB file on the machine where he is running this server. I have gui for the server mode where the user gets to choose the file using a JFileChooser.
"and it must also accept an indication that a local database is to be used" - how do you interpret this? is it talking about the program when started with the "alone" flag? If so why is it listed under the topic "server". It should be listed under "client".
I am giving a JFileChooser when he starts the program using "server" flag to choose the DB file, and the program when started in "alone" mode, brings up the client and gets to choose the Db file (using a JFileChooser) in the clients machine. When the program is started with no flags, the client interface is up in network mode, he gets a JDialog to enter the host to connect to.
[ September 25, 2003: Message edited by: Arun Kumar ]

SCJP (1.4), SCWCD, SCJD
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi Arun,
"In either case, the program must allow the user to specify the location of the database" - I interpret it as [...] the server program [...] should allow the user to choose the DB file on the machine where he is running this server

Some people have also interpreted this to mean that the client must be able to specify the location of the database. In local mode the location would be a local file. In remote mode the location would be a server name / port combination.
"and it must also accept an indication that a local database is to be used" - how do you interpret this?

I interpet it as talking about the client application starting in either "alone" or networked mode. The flag itself would be the indication that a local database is to be used.
why is it listed under the topic "server". It should be listed under "client"

Agreed.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
In remote mode the location would be a server name / port combination.
Some people have also argued that "location" means a remote client should also be able to specify the exact path on the server to the DB file. This seems a little crazy; I don't agree with it, but some people believe it's a proper interpretation of "specify location". Something to consider, maybe.


"I'm not back." - Bill Harding, Twister
 
jQuery in Action, 2nd edition
 
subject: about the "server" instructions
 
Similar Threads
location of database
How to process the networking with a local database?
NX: About the db file
NX: extends DB and fire listener
Database location