File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to throw RemoteException? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to throw RemoteException?" Watch "How to throw RemoteException?" New topic
Author

How to throw RemoteException?

Wu Ming
Greenhorn

Joined: Nov 01, 2003
Posts: 13
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?


SCJP, SCJD, SCEA (?) ....
Jonathan Liu
Greenhorn

Joined: Aug 21, 2003
Posts: 26
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

Joined: Nov 01, 2003
Posts: 13
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'
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to throw RemoteException?
 
Similar Threads
NX: Some question about DBAccess
NX: More interface confusion.
locking help
B&S 2.2.2 - Network Layer Query
GuiController design