4 Replies Latest reply: Jul 31, 2010 10:49 PM by EJP RSS

    Errors from server to client

    843793
      Hi!
      I'm not sure if this question belongs here, but I'll give it try. Here is my RMI application:
      public class ServerStarter {
        private static Properties setProperties(String arg) {
          try {
            //some code
          }
          catch(IOException e) {
            //TODO
            e.printStackTrace();
          }
        }
      
        public static void main(String[] args) {
          try {
            //some code
          }
          catch(Exception e) {
            //TODO
            e.printStackTrace();
          }
        }
      }
      public class DBServer implements ServerInterface, DBServerInterface {
      
        public DBServer(Properties props) throws SQLException {
          //some code
        }
      
        public List<List<String>> receiveDataFromServer() throws RemoteException {
          try {
            //some code
          }
          catch(SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        }
      
        public void writeDataToServer(List<List<String>> data) throws RemoteException {
          try {
            //some code
          }
          catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        }
      
        public Connection createConnection() throws SQLException {
          try {
            //some code
          }
          catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        }
      
        private void clearTable() throws SQLException {
          //some code
        }
      
        public void fillTable() {
          try {
            //some code
          }
          catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        }
      }
      public class ClientStarter {
      
        public static void main(String[] args) {
          try {
            //some code
          }
          catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        }
      }
      public class RMIClient implements ClientInterface {
      
        public RMIClient(ServerInterface stub)
            throws ClassNotFoundException, SQLException {
         //some code
        }
      
        public void callForData() {
          try {
            model.setData(stub.receiveDataFromServer());
          }
          catch (Exception e) {
            e.printStackTrace();
          }
        }
      
        public void sendData(List<List<String>> data) {
          try {
            stub.writeDataToServer(data);
          }
          catch (Exception e) {
            e.printStackTrace();
          }
        }
      }
      Now I need to get those exceptions from server to client. How should I do that?