Remote Interface
The DatabaseInterface is the interface
that defines the remote methods.
Listing 14.1
DatabaseInterface.java
import java.rmi.*;
import java.sql.*;
//remote interface
public interface DatabaseInterface extends Remote {
//method used to add a new record
public String addRecord(Student std)
throws RemoteException,SQLException ;
//method used to delete a record
public String deleteRecord(int rollNumber)
throws RemoteException,SQLException ;
//method used to update a record
public String updateRecord(Student std)
throws RemoteException,SQLException ;
//method used to find a record
public Object findRecord(int rollNumber)
throws RemoteException,SQLException ;
}
The code defines four methods used to add, delete, update, and find
a record. These methods will be invoked remotely by clients.
|