Pluggable RMI Application ?

Hi folks, there is this distributed, or rather, network application i built to be used in a LAN, where the client s(and server) connects to the DB server accross the network for data access. At start up, it displays a login UI to accept username and password from the user which after validation gives the user access.

Currently I created a config module (swing application) that lets the user configure the application parameters like database server hostname, database name, port etc for the DB connection, these are then saved in a properties file which the application reads and uses to connect to the DB server, this certainly has security draw backs cause every user now knows the DB server, the database, it's port, access username and password etc. I was wondering if RMI could be used to abstract the params and all such config to the my app's server and allow the clients to only connect, such that only the administrator of my app's server knows and has access to the params.

How can this be done so that the clients and even the app server can still remain a clikable and pluggable (can be carried to any pc and ran from it's JVM) jar file

[1175 byte] By [chalua] at [2007-10-3 9:23:33]
# 1

public interface Login extends Remote

{

Session login(String username, String password) throws RemoteException;

}

public interface Session extends Remote

{

DBParams getDBParams() throws RemoteException;

}

public class DBParams implements Serializable

{

// add the properties you want.

}

Only the Login object is bound into the Registry. On every successful login a unique new Session object is returned which gives access to the rest of the RMI application including all the access-controlled resources such as the DBparams. Add as many other remote methods to Session as you like. Tkey key thing is that you can only get a Session via a valid login.

ejpa at 2007-7-15 4:37:23 > top of Java-index,Core,Core APIs...