Two Laptop Bag*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Database file 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 "Database file" Watch "Database file" New topic
Author

Database file

Evans Tapia
Greenhorn

Joined: Jan 21, 2005
Posts: 5
Hi,

I noticed that in the project spec it says "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".

This is supposed to be included in the root of the big jar file (not he one with the executables), so should I assume that the database file can be located anywhere or in the directory where the runme.jar is located?

I was planning to include a properties file, but now I don't see the use of this, since the properties will be packed in the runme.jar, most probably the person who is going to test the app is not going to modify the properties file.

How are you dealing with the databse file? Where are you locating this file? Are you assuming a fixed position in a directory?

Thanks,
Evans
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Evans,

Your observation is correct: the database file could be put anywhere by the assessor, thus assuming it is e.g. in the root directory is probably not a good idea.

Since the instructions (at least mine do) explicitly state that you must not require that your assessor modifies any configuration file, the solution IMHO can only be that you provide a way in your GUI to select the database file location.

Frans.


SCJP 1.4, SCJD
Evans Tapia
Greenhorn

Joined: Jan 21, 2005
Posts: 5
I was thinking about this too, but that client-server architecture is not going to be very real.

I guess for testing purposes it works, but what if the server part is run in another computer where the client has no direct access to select a file? How can the client decide which database file to use? And as far as I know there's no gui for configuration on the server side.

Thanks,
Evans
Evans Tapia
Greenhorn

Joined: Jan 21, 2005
Posts: 5
Oh, I just re-read the whole spec file again and found this little pearl.

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

If I'm interpreting it correctly, I guess you are right, the GUI should have a window to specify which database file to use.

Evans
Eric Chang
Ranch Hand

Joined: Jan 27, 2004
Posts: 113
Evans, I think where you might be misunderstanding things (and I apologize if I'm wrong about you misunderstanding anything) is that the Server (in networked mode) must give the user some way to specify the database file. Therefore, the Client, in networked mode, does not have to know where the database file location is.
In standalone mode, the Client must provide some way for the user to enter in the database file location. Hope this clears things up.
Evans Tapia
Greenhorn

Joined: Jan 21, 2005
Posts: 5
Originally posted by Eric Chang:
Evans, I think where you might be misunderstanding things (and I apologize if I'm wrong about you misunderstanding anything) is that the Server (in networked mode) must give the user some way to specify the database file. Therefore, the Client, in networked mode, does not have to know where the database file location is.
In standalone mode, the Client must provide some way for the user to enter in the database file location. Hope this clears things up.


Oh, now I'm confused, how does the server will give the user a way to specify the database without specifying the location? That's way more complicated, I think, So the server will send a message asking the user to select a database file, but how the server know which are the database files, it will have to have the files in a certain directory then.

Any other opinions about the subject?

Thanks,
Evans
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
no.
When running in networked mode the server has its own GUI to set options like the database file, port, etc.

When running local the client can select the local database file directly (or you could have a local server directly talking to the client instead of a networked server).


42
Eric Chang
Ranch Hand

Joined: Jan 27, 2004
Posts: 113
OK, here's as clearly as I can break it down:

If I'm at one computer, and I start the server, the database file must be on that same computer somewhere. So when I start the server, I am prompted to enter the location of the database file (and server port).

I'm at another computer and start the client and am prompted to enter the IP of the server and port. I'm at this other computer and have absolutely no need to know where the database file is. Only the person who started the server needs to know where it is.

Now, if I'm running the client in standalone mode, then I am prompted to enter ONLY the location of the database file, which would probably exist locally on the same machine.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
correct. Except of course the path to the file can be any UNC path that allows read/write access. I'd not demand it be at the same computer.
Eric Chang
Ranch Hand

Joined: Jan 27, 2004
Posts: 113
Yes, that is true...I just used that to make my example clearer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Database file
 
Similar Threads
Current Working Directory?
Simpel question...
help , how to package
(NX:URLyBird)A question about properties files:
configuration in suncertify.properties