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 Location of db.db 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 "Location of db.db" Watch "Location of db.db" New topic
Author

Location of db.db

Pallav Grigo
Greenhorn

Joined: Mar 29, 2002
Posts: 29
Hi everyone..a q about the location of the database file...currently i have a server.jar and a client.jar..but they only work if they are in the same directory as db.db..for example if i want to run the server, server.jar n db.db must be in the same directory..or say i want to access the database locally..then client.jar n db.db must be in the same directory...
do u think i'll lose marks for this??
Regards,
Pallav.
Pallav Grigo
Greenhorn

Joined: Mar 29, 2002
Posts: 29
hi everyone..i've changed my program a little bit..the client.jar pops up a file chooser if the mode is local...so that problem is solved..but i still have problem with my server.jar
do i need to set classpath if i i'm running the jar from some other directory?? also what about the location of the security manager policy file??
Regards,
Pallav.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I passed the database file name using the configuration parameter during the server startup and didn't use policy file or RMISecurityManager in server or client.
Pallav Grigo
Greenhorn

Joined: Mar 29, 2002
Posts: 29
Hello Sai..So if I dont use a RMISecurityManager...i dont need the policy file at all?? That would solve my problem..but i'm afraid that i would lose marks..because i dont know what justification i would give in my Design Choices...what do you think??
Regards,
Pallav.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Pallav:
If you don't dynamically download _Stub files, there is no need for RMISecurityManager and policy files. I cannot say if you lose any marks because I am still waiting my results. I will keep you posted!
Pallav Grigo
Greenhorn

Joined: Mar 29, 2002
Posts: 29
Thank you Sai..I think I'll go without specifying any security files or managers..because as you said I'm not using dynamic loading of any stubs..just one more doubt though...Right now for my server..i take three parameters...
1 - port to be used by RMI Registry
2 - the name and path to local database file
3 - the "service" name(the name bound to registry)
and in my requirements i'm only allowed:
1 - DNS name of the server
2 - Port number used by the server
3 - Data file name(s)
4 - java.rmi.server.codebase
5 - security manager policy file
so my question is that does my third parameter fit into any of those specified by SUN?
Thanks.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I am afraid not. I had a class called FBNNames where I stored the object names bound to the RMI Registry as constants and they can be refered by both client and the server.
[ May 21, 2002: Message edited by: Sai Prasad ]
Pallav Grigo
Greenhorn

Joined: Mar 29, 2002
Posts: 29
THanks Sai!!
Pallav.
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
I think it's a good idea to let the user to specify multiple database files when the server is started. For example:
java StartServer 1099 db.db,db1.db,db2.db
This is how I implemented it, and it's very flexible. The server holds the file names in the HashMap. When a connection is requested for a particular database, the server opens the data file, creates an instance of Data for that connection, and puts that instance in the map. Next time the connection is requested, the server just retreives that instance of data from the map, wraps in in the remote object, and returns it to the user.
Eugene Kononov.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Location of db.db
 
Similar Threads
readme.txt
Jar
Submitting the Project
Class directories for network mode
question abuot 'jar'