Hi, what I did is the following: 1. server administrator will enter the port from the command promp 2. database location determined by using: String dir = System.getProperty("user.dir"); dir.concat("/suncertify/db/db.db"); 3. in case of network connection, the user will enter the computer name he wants to connects to (of course, where the database locate). later, I will let the user to use JFileChooser to find the database location or by typing the location into a JTextField.
1. server administrator will enter the port from the command promp
If your assignment is the old one, I think it is ok as it has no limitation on running the application. However, if your assignment is the new one, the only command that you can used are: 1. java -jar runme.jar (for client network mode) 2. java -jar runme.jar alone (for client standalone mode) 3. java -jar runme.jar server (for starting up the server) Thus, any info that must be pass to the programs, what I did, can only be do so by capturing them via a GUI.
2. database location determined by using: String dir = System.getProperty("user.dir"); dir.concat("/suncertify/db/db.db");
This sounds reasonable, but for a bit more flexiability, I create 1 more button "Select" in the configuration GUI, for the client to choose his own db file. And my program checks the "magic cookie" to see whether the chosen file is a valid one. Nick.
thanks for your reply, It is the old assignment (FBN).
This is what I meant by using JFileChooser, but what about the validation of the file, shall I do checking on the name of the database file which is "db.db" or there is something else. don't you think even if you choose wrong file, an exception will be thrown throw the processing of the database?
If I do a check for it, how do I know they won't run my app against another db file with a different magic cookie value?
From the magic cookie's definition in the instructions: "4 byte numeric, magic cookie value. Identifies this as a data file". I think that from that "a", we can deduce that other possible data files would have the same magic cookie value. Best, Phil. [ January 31, 2004: Message edited by: Philippe Maquet ]