Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to throw RemoteException?

 
Wu Ming
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a interface DataInterface to extend the interface DBAccess.
public interface DataInterface extends DBAccess, Remote {
public interface DBAccess{
public String [] readRecord(long recNo) throws RecordNotFoundException;
public void updateRecord(long recNo, String[] data, long lockCookie) throws RecordNotFoundException, SecurityException, RemoteException;
public void deleteRecord(long recNo, long lockCookie) throws RecordNotFoundException, SecurityException, RemoteException;
public long[] findByCriteria(String[] criteria) throws RemoteException;
public long createRecord(String [] data) throws DuplicateKeyException, RemoteException;
public long lockRecord(long recNo) throws RecordNotFoundException, RemoteException;
public void unlock(long recNo, long cookie) throws SecurityException, RemoteException;
}
But they say the interface DBAccess doesn't throws RemoteException? How to deal with this? If I don't extends the DBAccess? how to relize the method to get the columna name of the DB?
Is somebody have good idea?
 
Jonathan Liu
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because in interface DBAccess, findByCriteria(String[] criteria) doesn't throw RemoteException, so your DataInterface implementation should not implement a method with signature like this.
So I suggest you copy some signatures from DBAccess to your DataInterface ,and just let DataInterface extends Remote
 
Wu Ming
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NX: NOTE: this is new assignment about URLBird
Originally posted by Jonathan Liu:
Because in interface DBAccess, findByCriteria(String[] criteria) doesn't throw RemoteException, so your DataInterface implementation should not implement a method with signature like this.
So I suggest you copy some signatures from DBAccess to your DataInterface ,and just let DataInterface extends Remote

Yes, I see. If do as you say, Nothing will happen. But how to deal with the interface of DBAccess required by the assignment? Just Let it be? It will fail to fit the requirement of 'must'
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic