aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes db location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "db location" Watch "db location" New topic
Author

db location

jian zheng
Greenhorn

Joined: Jan 07, 2004
Posts: 21
Hi all,
I'm really annoied with my poor English ability ,I don't know if I understand the requirement really.
Here it is :
"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. "
It means user can specify db file's location when start server,right?But not any platform has x-server,so I allow user to input file location when they start server(not GUI),is it ok?
And I don't know what's the meaning of "in which case, the networking must be bypassed entirely" mentioned upon.For example,my machine's ip address is 192.168.0.7,and this is my db server,and I must allow use to locate a local db file but forbid user to locate an db file on 192.168.0.8.Does it mean?
Thks!
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Hi Jian,
Originally posted by jian zheng:
It means user can specify db file's location when start server,right?But not any platform has x-server,so I allow user to input file location when they start server(not GUI),is it ok?

Yes, I think when you start the server that you need to provide the user a way to specify the db file's location. You also need to provide the user a way to specify the db file's location when you start the application in standalone mode. To do this, I think you will need to use a GUI that allows the user to enter the location of the db file (a JFileChooser is a nice Swing component to help you do this). I guess, it's true that not every platform has an x-server, but then I think the assignment instructions prohibit your server from running on such a platform because they require the db file location to be configurable, yet they prohibit the use of any command-line parameters beyond those specifically allowed by the assignment instructions.
I think you will find that your assignment instructions contain a statement similar to the following:

When you submit your assignment, each part (client and server) must be executable using a command of this exact form:
java -jar <path_and_filename> [<mode>]
Your programs must not require use of command line arguments other than the single mode flag, which must be supported. Your programs must not require use of command line property specifications. All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.
The mode flag must be either "server", indicating the server program must run, "alone", indicating standalone mode, or left out entirely, in which case the network client and gui must run.


And I don't know what's the meaning of "in which case, the networking must be bypassed entirely" mentioned upon.For example,my machine's ip address is 192.168.0.7,and this is my db server,and I must allow use to locate a local db file but forbid user to locate an db file on 192.168.0.8.Does it mean?

I think you will find it necessary to develop an interface (similar, but perhaps not identical, to the one provided by Sun) that declares the database operations that can be performed by the database. This interface can be used to support all the database operations that can be performed by the client (regardless of whether the client is local, or whether the client is remote). This interface can be implemented by two classes. One of these classes could support the database operations for a local database file (that is, networking will be bypassed entirely), the other of these classes could support the database operations for a remote database file. Your application will need to determine in which mode it is operating (perhaps by examining the approved command-line argument), and then instantiate the appropriate implementation of your interface depending on whether the operating mode requires a local or remote database file.
I'm not sure I understand your example, but I can say generally that you will not have to forbid a user to locate a db file on a particular machine.
Hope this helps,
George
[ February 04, 2004: Message edited by: George Marinkovich ]

Regards, George
SCJP, SCJD, SCWCD, SCBCD
jian zheng
Greenhorn

Joined: Jan 07, 2004
Posts: 21
Hi George,
Thank you ,I think I'v not read the document carefully provided by Sun,and you give me an important review.I agree with your point about db location,I'll use GUI in server side as what I've done in client side to locate db file.
Thks again
Best Regards!
Jian
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: db location
 
Similar Threads
Network approaches confusing statement
FileChooser
How to process the networking with a local database?
How many modes are there for the program?
URLyBird 1.2.2 confusion in the spec