Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating a biderctional RMI program

Posted on 2011-03-24
3
Medium Priority
?
353 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 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

604 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