Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Location of db.db

 
Pallav Grigo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THanks Sai!!
Pallav.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic