Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Simpel question... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Simpel question..." Watch "Simpel question..." New topic
Author

Simpel question...

Allan Smith
Greenhorn

Joined: Aug 18, 2005
Posts: 16
Hi!

I'm currently doing the B&S assignment. This is what the specification says:

"
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.
"

Could someone please help me to clarify if this means I have to present a dialog to the user where he can search for the database on the local computer? Or in both the local and rmi-implementation, a simple dialogbox where he can enter the full path to the database?

I have trouble understanding what to do with the database with the final solution; whether to include it in the Jar-file and assume this is the loation of the file, or to let the user specify it...

Thankx!
Allan Smith
Greenhorn

Joined: Aug 18, 2005
Posts: 16
I have on more question. My assignment clearly states that the program to be devloped should handle functionality like: listing contractors, searching and booking. However, my dabase interface class, provided by Sun, has methods like deleteRecord and createRecord. What's up with this? Am I to implement these too or should I just leave them alone??
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11503
    
  95

Hi Allan,

In my opinion, the "location of the database" means different things depending on which mode you are in:
  • If you are running as a standalone client, then the location of the database would be the location of the physical file somewhere on a locally accessible disk drive. You would need to provide some way for the user to enter this location (and preferably just search for it (hint:JFileChooser)). As specified elsewhere in your instructions, this location would be stored in the properties file, and offered as a default location for the next time the application is run.
  • If you are running as a server, then the location of the database would be the location of the physical file somewhere on a locally accessible disk drive. You would need to provide some way for the user to enter this location (and preferably just search for it (hint:JFileChooser)). As specified elsewhere in your instructions, this location would be stored in the properties file, and offered as a default location for the next time the application is run.
  • If you are running as a networked client, then the location of the database would be the computer where your server application is running. So you would need to have some way for the user to enter the server address or IP address (and optionally the port number if you allow that to be changed).As specified elsewhere in your instructions, this location would be stored in the properties file, and offered as a default location for the next time the application is run.

  • Originally posted by Allan Smith:
    I have trouble understanding what to do with the database with the final solution; whether to include it in the Jar-file and assume this is the loation of the file, or to let the user specify it...

    From my copy of the instructions:
    Packaging of Submissions
    All elements of your submission must be packaged in a single JAR file. The JAR file must have the following layout and contents in its root:
  • The executable JAR containing the programs. This must be called runme.jar.
  • The original, unchanged database file that was supplied to you. Note that you must keep a copy of the original database file supplied to you, and this must be the file you submit. The marking process will expect the exact same data without any changes.
  • A directory called code, containing all the source code and related parts of your project. You must create subdirectories within this to reflect your package structure and distribute your source files within those directories.
  • ...
  • According to the second item, it must be in the root directory of your submission jar (not your runme.jar), which will be unpacked into some unknown directory on the assessor's computer. So you are going to have to allow the user to specify where the file is.

    Originally posted by Allan Smith:my dabase interface class, provided by Sun, has methods like deleteRecord and createRecord. What's up with this? Am I to implement these too or should I just leave them alone??
    Take a look at the JavaRanch SCJD FAQ.

    Regards, Andrew


    The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Simpel question...