Solved

Creating a biderctional RMI program

Posted on 2011-03-24
3
324 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
  • 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error trying to install RTMT Win7 5 60
servlet requestdispatcher include and forward differences 1 30
check java version using powershell 13 92
spring jars download 1 27
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

773 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