File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes execution and executable Jar question for SCJD 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 "execution and executable Jar question for SCJD" Watch "execution and executable Jar question for SCJD" New topic
Author

execution and executable Jar question for SCJD

Prash Gali
Greenhorn

Joined: Dec 20, 2005
Posts: 22
My assignment states 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."

Question 1) Does this mean that I must have 2 executables (one for client and the other for server) as the assignment states. At this point of time, I have one jar that contains all my class files. I dont know if this will violate the must condition.

Question 2) If user choose to the run the application in stand alone mode, i have a UI for the user to browse for the database file from local file system each time. Is this wrong? should i be persisting this afer the first time as the assignment states? If yes, then the only way user change the database location is by editing or deleting the properties file. Which is something i would hate to do if I am user of the application.

Please help


SCEA 5.0 SCJD SCBCD
Prash Gali
Greenhorn

Joined: Dec 20, 2005
Posts: 22
Sorry, remaining portion of the assignment that i missed to post in my post...

"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."
Lucy Hummel
Ranch Hand

Joined: Apr 07, 2005
Posts: 232
Hi Prash,

1) Just one jar file

2) There are two command line options, please see URLyBird: runme.jar for example.
If that still does not help, feel free to use the search button of your forum


----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
Mark Smyth
Ranch Hand

Joined: Feb 04, 2004
Posts: 288
Originally posted by Prash Gali:
My assignment states the following

Question 2) If user choose to the run the application in stand alone mode, i have a UI for the user to browse for the database file from local file system each time. Is this wrong? should i be persisting this afer the first time as the assignment states? If yes, then the only way user change the database location is by editing or deleting the properties file. Which is something i would hate to do if I am user of the application.

Please help


You could show the UI you have developed via a menu in the application that would allow the user to change the file location while the program is running (No need for changes to take effect until the program is restarted.

What would be a good idea is to default to the stored file location on startup but to allow the user to change the location of the data file if desired via a startup dialog. This could be done with just a textfield to display the current default location, a browse button to pop up a filechooser and a connect button to launch the application.


SCJP<br />SCJD
Prash Gali
Greenhorn

Joined: Dec 20, 2005
Posts: 22
Thank you Mark and Hummel for your reply.

@ Mark,
I would like to make sure i understand you statement.
So, we would default to the stored file location and then, display a dialog asking....would you like to change the database location? if yes, provide a dialog to choose the desired database file. All this interaction will happen before show the CSR client application.
Prash Gali
Greenhorn

Joined: Dec 20, 2005
Posts: 22
Thank you Mark and Hummel for your reply.

@ Mark,
I would like to make sure i understand you statement.
So, we would default to the stored file location and then, display a dialog asking....would you like to change the database location? if yes, provide a dialog to choose the desired database file. All this interaction will happen before showing the CSR client application.
Prash Gali
Greenhorn

Joined: Dec 20, 2005
Posts: 22
Prash Gali
Greenhorn

Joined: Dec 20, 2005
Posts: 22
Mark Smyth
Ranch Hand

Joined: Feb 04, 2004
Posts: 288
Originally posted by Prash Gali:
Thank you Mark and Hummel for your reply.

@ Mark,
I would like to make sure i understand you statement.
So, we would default to the stored file location and then, display a dialog asking....would you like to change the database location? if yes, provide a dialog to choose the desired database file. All this interaction will happen before showing the CSR client application.


That is exactly the way that I implemented this behaviour, I had a textfield with the stored file location displayed. If the user was happy the could click the connect button. If not they could click browse and chose a new file whose location would then be displayed in the textfield. I think it is better approach than never asking the user again after the first time they run the application.

Mark.
Prash Gali
Greenhorn

Joined: Dec 20, 2005
Posts: 22
thank you mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: execution and executable Jar question for SCJD