This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes how to perform database operations using rmi? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "how to perform database operations using rmi?" Watch "how to perform database operations using rmi?" New topic
Author

how to perform database operations using rmi?

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 902
hello, i am just trying to perform some database operations using rmi (ie. insert records into database).
i mean my database is on server and i want when client run the client program, some data should insert to the database which is on server.
Here is what i am trying:

DatabaseServer.java


DatabaseClient.java

here is the interface "DatabaseInterface.java"


but now how do i perform database operation???
Chris Janicki
Greenhorn

Joined: Aug 30, 2006
Posts: 21

Well, your client app has to call an RMI method on the server app. It looks like you've set up an add() method for that purpose. So after the client grabs the server reference (you've already done that), then call rmiServer.add(). Of course you still have some work to do… that add() method needs to be expanded to accept some parameters (the stuff you want to add), and the method signature line needs to throw RemoteException, since that's what your interface declares (and required for RMI methods).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to perform database operations using rmi?
 
Similar Threads
Rmi BAsic Problem
RMI client server don't work on ipv6 machines
RMI pass by value or by reference ?
how to start server in command line...
can't solve the problem on RMI client code