0 Replies Latest reply: Apr 1, 2012 1:43 AM by 926625 RSS

    Error in handlinh web service

    926625
      Hello,
      I created a web service in which, i am calling a procedure from oracle apps.
      I am passing 3 values to procedure and getting one as a flag (Y or N) and other is null.
      So while handling null value i am getting error as :
      java.lang.nullpointer.........
      I am posting my code here.


      public ArrayList getApprove(int notification_id, String note, String username){
      ArrayList error=new ArrayList();
      con=getEBSConnection();
      try {
      cst= con.prepareCall("{call INOTIFICATION_PKG.approve_notification(?,?,?,?,?)}");
      cst.setInt(1,notification_id);
      cst.setString(2,note);
      cst.setString(3,username);
      cst.registerOutParameter(4,Types.VARCHAR);
      cst.registerOutParameter(5,Types.VARCHAR);
      cst.execute();

      error.add(cst.getString(4));
      String error_handle=cst.getString(5);

      if(error_handle.equals(null)){
      error_handle="Sucessfull";
      error.add(error_handle);
      }
      else{
      error.add(cst.getString(5));
      }
      } catch (SQLException e) {
      System.out.println("No Such Record");
      }
      return(error);
      }


      Reply.....