This is the beginning of the tutorial.
import wfc.data.*;
public class RDSTutorial
{
public void tutorial()
{
// Step 1—Specify a server program
ObjectProxy obj =
DataSpace.createObject(
"RDSServer.DataFactory",
"http://YourServer");
// Step 2a—Invoke the server program with RDS.DataControl
This example is merely a comment demonstrating that the default behavior of the RDS.DataControl is to perform the specified query.
DataControl dc = new DataControl();
dc.setSQL("SELECT * FROM authors");
dc.setConnect("DSN=pubs");
dc.setServer("http://YourServer");
dc.Refresh();
// Step 2b—Invoke the server program with RDSServer.DataFactory
// Step 3—Server obtains a Recordset
// Step 4—Server returns the Recordset
Recordset rs = (Recordset) obj.call(
"Query",
new Object[] {"DSN=pubs", "SELECT * FROM authors"});
// Step 5—DataControl is made usable by visual controls
DataControl dc = New DataControl();
dc.setSourceRecordset( rs );
// Step 6a—Changes are sent to the server with RDS.DataControl
This example is merely a comment demonstrating how the RDS.DataControl performs updates.
For the sake of convenience, extract the Recordset object from the RDS.DataControl, edit it, then restore it to the RDS.DataControl. After that, update the data source.
...
dc.Refresh();
Recordset rs = dc.getRecordset();
... // Edit Recordset
dc.setSourceRecordset(rs);
dc.SubmitChanges();
...
// Step 6b—Changes are sent to the server with RDSServer.DataFactory
... // Edit Recordset
obj.call(
"SubmitChanges",
new Object[] {"DSN=pubs",(Recordset) rs});
return;
}
}
This is the end of the tutorial.