The following set of code will help you for getting data from any database just by specifying the table name . The database from which you need to get the data should have an RMI wrapper ,which is nothing but an RMI server ( using activation model) running . The database need not be connected in the same network where your client program will be running . It can also sit behind a proxy . In that case the RMI server should run on the Proxy machine .

A set of API's are provided which will help in programming the client easy . The API also contains the functionality of making the non serialized ResultSet in the java.sql package into a serialized format . Not all the methods in the ResultSet interface are implemented . Only the getObject method is implemented

A typical application can be a synching process where you need to see the local database and a remote database together . Any move table from one database to other . The remote database can be behind a proxy . In that case you will run the RMI server coming in the machine where proxy is running . You just need to give the RMI server you login and passwd which is going to be the database login and passwd . The program need to be modified by changing the IP address of the machine in which oracle in running and it's sid. ( all these information you can get from your system administrator ). Then for retrieving the table from the remote database you just give the table name . The RMI server will return you the Table in a fixed format (SyncResultSet format ) . Using methods of SyncResultSet and RawDataField you can retrieve information like name of the column it's datatype and its value which is stored as a java Object

For changing the remote database a method inserOrUpdate is provided . It will insert of update the table depending up on the value of the primary key's of the table or depending on the value of the key that you specified as the constraint field
For free download click here

Hosted by www.Geocities.ws

nav
Free College Money
nav
[Close]
nav
[Close]
1 1