Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

Creating a biderctional RMI program

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
deko007
Asked:
deko007
  • 2
1 Solution
 
for_yanCommented:
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
 
deko007Author Commented:
Thanks
I didn't program that,but your solution suond very good solution' i am going to implement it
0
 
for_yanCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now