wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Is database name really needed as command line parameter ? 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 "Is database name really needed as command line parameter ?" Watch "Is database name really needed as command line parameter ?" New topic
Author

Is database name really needed as command line parameter ?

John Chien
Ranch Hand

Joined: Feb 06, 2003
Posts: 105
Hi,
According to Sun's assignment, we can use database name as one of the command line parameter.However, I am wondering about its necessity.
In a real time application, the database name is always encapsulated by the server implementation. No matter if the server is remote or local.
This encapsulation can be achieved using system property file. Thus we do not need to worry if the database location or name got changed.
Why does SUN allow us to use it as part of the input parameter ? Can we remove it from the command line parameter ?
John Chien


SCJP, SCJD, SCWCD, SCBCD<br />IBM Certified Specialist (158)<br />Oracle9i PL/SQL Developer Certified Associate
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Here the word "can", means an option. If you want to you "can" use this command line. It doesn't mean you "have" to.
I can see where sometimes when english isn't your first language that this can be confusing. So don't worry about it.
Some people have a screen that allows the user to select the data file and some other things, others put it on the command line, and some people like me hardcoded the db.db file location because the instructions also said I could.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
You need the location of the database file in local mode. Obviously, in networked mode, clients shouldn't care about where the file lives.
As to your last question, I'd suggest you stick to the letter of Sun's requirements regarding the command line.
- Peter
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

"I'd suggest you stick to the letter of Sun's requirements regarding the command line"
Does that mean that you think the requirements in the Instructions.html states that you must use the command line for the location of the db file?
Mark
John Chien
Ranch Hand

Joined: Feb 06, 2003
Posts: 105
Mark,
Thank you for the answer.
However,please do not insult me about my English. I DO know what "can" mean. I am just wondering the reason Sun allows (can use) the database name as commandline parameter. I do not think we can find this in the real application.
John Chien
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Mark Spritzler:
[QBDoes that mean that you think the requirements in the Instructions.html states that you must use the command line for the location of the db file?[/QB]
Ah. Ok, I was probably confused. No, of course not; you can use a command line parameter, or you can pop up a dialog box (not a good idea IMHO), or you can hardcode a relative path. You wouldn't be able to do the same thing for the server though.
Why I don't think dialog boxes are a good idea? Well, apart from the fact that they are more work , they also are a really poor fit for my interpretation of the business problem. I don't see the point of forcing a travel agency's sales assistant to know the location of a file or a server! You want the techie who installs the software to configure where the file and/or server lives, and not bother the sales people with it.
- Peter
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

However,please do not insult me about my English.

No, I wasn't trying to insult you, I was just trying to help. Please accept my apology.
Mark
John Chien
Ranch Hand

Joined: Feb 06, 2003
Posts: 105
OK. I think I got the point. This is not an application for techie. This is really an application for Sales or business person who may not have an assistence around.
John Chien
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Don't think of this as a real-world application, it is only symbolic of a real application.
Don't treat it as a real product because it is about as real as the first Hello World program you wrote in BASIC back in 3rd grade; if you do this you will miss the whole point of the assignment.
The test here is not to see if you can make a flight booking system, it is to see if you can design and build an application using consistent application of good programming practices and style while satisfying some requirements that are simple, vague, precise, and ambiguous all at the same time.
 
GeeCON Prague 2014
 
subject: Is database name really needed as command line parameter ?