aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Database connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Database connection" Watch "Database connection" New topic
Author

Database connection

Brian Blignaut
Ranch Hand

Joined: Jan 08, 2003
Posts: 61
Hi,
For connecting to the database I display a dialog which allows the user to select whether they would like a local or remote database connection. If remote is selected I display a text field which allows the user to enter the hostname of the machine wishes to connect to. I was wondering, for the local mode, if I should allow the user to select the db.db file to connect to i.e. with a file chooser dialog
Any suggestions would be appreciated
Brian
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

I was wondering, for the local mode, if I should allow the user to select the db.db file to connect to i.e. with a file chooser dialog

The requirements are very clear, -- in local mode, the user must be able to specify the location of the database.
Eugene.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Originally posted by Eugene Kononov:

The requirements are very clear, -- in local mode, the user must be able to specify the location of the database.
Eugene.

Must? I never saw that, and in my submission I hard coded the location of the db.db file, user cannot specify the location and didn't lose any points.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

Must? I never saw that, and in my submission I hard coded the location of the db.db file, user cannot specify the location and didn't lose any points.

Perhaps your assignment was different. Did you have this in your instructions: ".. 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"?
Eugene.
[ February 24, 2003: Message edited by: Eugene Kononov ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Yes in the Network approaches section. And I took it to mean which mode to be in.
The Location of the database is it locally or remotely.
So my start of the client was either
"java -jar client.jar" for local mode
or
"java -jar client.jar <<serverAddress>>" for remote mode. This fulfilled that requirement.
Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database connection