You connect to a database in an RMI program the same way you would in any other program (Which is a question for either the JDBC or the J2EE forums...). If you're asking how you connect to a database *using* RMI - that's not what RMI is used for...
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
The UnicastRemoteObject class defines a non-replicated remote object whose references are valid only while the server process is alive. The UnicastRemoteObject class provides support for point-to-point active object references (invocations, parameters, and results) using TCP streams.
Objects that require remote behavior should extend RemoteObject, typically via UnicastRemoteObject. If UnicastRemoteObject is not extended, the implementation class must then assume the responsibility for the correct semantics of the hashCode, equals, and toString methods inherited from the Object class, so that they behave appropriately for remote objects.