Solved

Creating a biderctional RMI program

Posted on 2011-03-24
3
339 Views
Last Modified: 2012-05-11
Hi
i have an RMI program that can get data from the server(CacheRowSet object).
I would like to give the client the possibilty to update a row in the table send it to the server and the server will update DB and clients.
right now the program can update DB and clients but can't get data change from clients.
I will be hppy to hear any suggestions for doing so .
Thanks
0
Comment
Question by:deko007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 250 total points
ID: 35209131
In order to do so you need to have in your RMI server part
another method which will do update of the database.
Everything else remains the same, you just need to add additions method
to the server and to the Remote interface and you have method
say

boolean UpdateTable(String s)

and your string may be an SQL string which you'll generate on the client and send it to
RMI sever and return value can tell you whether the update was successful or you can make it return integer
and it will tell you how many rows were updated

You don't need any special RMI for that purpose - just another method within your RMI server.

And of course you can keep it all eve within one method and
spcify in its parameters if you want to update or to select.

Probably with two metods it will be cleaner - these decisions more depend on
how often you'll run selects and updates, at waht times, etc.
But RMI as it is is fully equipped for handling this situation - I used both ways a lot.
0
 

Author Closing Comment

by:deko007
ID: 35210747
Thanks
I didn't program that,but your solution suond very good solution' i am going to implement it
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35210775
Yes, it works for me for many years.
Let us know in case you have any questions.
In general, RMI in my mind is in many cases a very convenient and underappreciated technology,
much easier to imlement and with smaller overhead than say web services.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question