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

Database Location

Farouk Mohamed1
Ranch Hand

Joined: Jul 26, 2001
Posts: 113
Hi
can you please tell me who you deal with database location?
Question:
If you specify a standard database location for local mode it will work fine using your db.db file, what will happen if the tester uses the RMI server and starts it up in that case how will the user know where the data is on the remote server (even if the tester acts as a user and starts in the RMIServer ini the same machine how will he specify the database location).
I understand the database files for remote and local can be different files and how will the user specify it or when he starts the server or he want to go local mode
Bugging me all the time please help?
Farouk
Farouk Mohamed1
Ranch Hand

Joined: Jul 26, 2001
Posts: 113
any comments plase
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
? The relevant object or factory is bound in the RMI registry under the name "FlyByNightBookingTable" or whatever. Why should the client have to know where the file resides on the server?
- Peter
Farouk Mohamed1
Ranch Hand

Joined: Jul 26, 2001
Posts: 113
Peter
Thanks for your quick reply, What i understand from what you say is user need not supply the database location in any case local or remote.
For local mode we should specify a default directory for the application to point to and for remote u are saying the RMIserver
should be supplied a database location when it is started so that it can bind the RemoteConnectionFactory object with the registry supplying a database location

Am i right?
Please reply
Farouk
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
You can argue that in local mode the user should indicate the location of the file. You can also argue that the file should reside in a certain directory. That's a design decision, up to you to make.
In remote mode you can argue that it's OK for the user to give the RMI registry host :port. Perhaps also the name under which the database is bound in the registry (another design decision). But IMHO having the user indicate the location of the data file on the server machine is a mistake. That's up to the server administrator to decide.
- Peter

[This message has been edited by Peter den Haan (edited November 07, 2001).]
Farouk Mohamed1
Ranch Hand

Joined: Jul 26, 2001
Posts: 113
Hello peter
Thanks for your reply, I have decided to make a specified data file location for local mode and cannot be changed and as well for remote when the RMIServer is started by the adminstrator he supplies as well a database location to be used.
To make the application simple in anycase the user will not know
about the database file and its local he know only local mode
and in remote he supplies a host name and port no
Is this design agreeable
Please reply
Farouk
Farouk Mohamed1
Ranch Hand

Joined: Jul 26, 2001
Posts: 113
Peter
Please comment on my reply please is this design agreeable
Farouk
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
I'm fine with it, Farouk, but ultimately I'm not the arbiter of which designs are agreeable and which aren't Have, however, a careful read through your instructions. For instance I don't think hardcoded absolute file paths are encouraged.
- Peter
[This message has been edited by Peter den Haan (edited November 09, 2001).]
Farouk Mohamed1
Ranch Hand

Joined: Jul 26, 2001
Posts: 113
Hi peter
Thanks for your reply, what i mean by specified location for db.db file is i am going to use system.properties for getting the user directory and the file will always be present in the user directory from which he is runnign the application
It is never hard coded as i understand this application will run on different machines.
Is it ok?
Thanks
Farouk
 
wood burning stoves
 
subject: Database Location