• 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

db location

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
jian zheng
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic