This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to perform database operations using rmi?

 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
Mac OS X Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic