public void updateRequestHandler(String[] parameters) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.updateUserDetails(parameters);
      sql.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public ResultSet getRequestHandler(String User) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      return (ResultSet) sql.authRequest(User);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  public void deleteTransaction(String[] rID) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.deleteTransactions(rID);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public ResultSet getTransactionHandler(String status, int critical, String payment) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      return (ResultSet) sql.authTransaction(status, critical, payment);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  public void updateTransactions(String rStatus, String[] rID) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.updateTransactionData(rStatus, rID);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public ResultSet getModDelHandler(String modifyStatus, String payment, int critical) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      return (ResultSet) sql.modifyDeleteTransaction(modifyStatus, payment, critical);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  public void declineRequestHandler(String newvalue, String columnname, String user) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.declineRequestDatabase(newvalue, columnname, user);
      sql.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public void modifyTransaction(String[] rID, String status) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.modifyTransactions(rID, status);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public void rejectTransaction(String rStatus, double balance, String[] rID) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.rejectTransactions(rStatus, balance, rID);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public void requestModifyHandler(
      String user, String parameter, String parametertype, String usertype) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.insertintoRequestDatabase(user, parameter, parametertype, usertype);
      sql.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public Double getSourceBalance(String accountNumber) {
    double result = 0.0;
    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      result = sql.getBalanceSourceAccount(accountNumber);

    } catch (Exception e) {
      e.printStackTrace();
    }
    return result;
  }
  public Boolean checkAccountNumber(String accountNumber) {
    Boolean result = true;
    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      result = sql.checkValidAccount(accountNumber);

    } catch (Exception e) {
      e.printStackTrace();
    }
    return result;
  }
  public Boolean checkSameSource(String[] rID) {
    boolean result = false;
    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      result = sql.checkSameSourceAccountNumber(rID);

    } catch (Exception e) {
      e.printStackTrace();
    }
    return result;
  }
  public ResultSet checkRequestStatus(String rID) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      return (ResultSet) sql.checkStatus(rID);

    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  public Double getBalance(String[] rID) {
    double result = 0.0;
    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      result = sql.getBalanceAmount(rID);

    } catch (Exception e) {
      e.printStackTrace();
    }
    return result;
  }
  public void approveModifySourceTransaction(
      Double newAmount, String rStatus, double balance, String[] rID) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.approveModifySourceTransactions(newAmount, rStatus, balance, rID);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public void deleteRequestHandler(String userName, String accountnumber) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {

      sql.deleteUserDetails(userName, accountnumber);
      sql.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public ArrayList<String> checkStatusOfId(String[] rID) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    ArrayList<String> status = new ArrayList<String>();
    try {
      status = sql.checkStatus(rID);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return status;
  }
  public String getSourceAccount(String rID) {
    String result = "";
    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      result = sql.getSourceAccountNumber(rID);

    } catch (Exception e) {
      e.printStackTrace();
    }
    return result;
  }
  public Object updateaccountrequest(String username, String manager, String Accountnumber) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      sql.insertAccountChangeRequest(username, manager, Accountnumber);
      sql.close();
    } catch (Exception e) {
      e.printStackTrace();
    }

    return null;
  }
  public void updateCountHandler(int count, String Username) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {

      sql.updatecountDatabase(count, Username);
      sql.close();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public void setloggedin(String Username) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {

      sql.setisloggeddb(Username);
      sql.close();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public Object requestManagers() {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      Object obj = null;
      obj = (Object) sql.readSystemManagers();
      sql.close();
      return obj;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  public ResultSet requestCountHandler() {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      ResultSet obj = null;
      obj = (ResultSet) sql.countRequestDatabase();
      sql.close();
      return obj;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  public Object viewRequestHandler(String Manager) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      Object obj = null;
      obj = sql.viewRequestDatabase(Manager);
      sql.close();
      return obj;
    } catch (Exception e) {
      e.printStackTrace();
    }

    return null;
  }
  public Object requestHandler(String userName, String parameterType) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      Object obj = null;
      obj = (Object) sql.readModifyUser(userName, parameterType);
      sql.close();
      return obj;

    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  public Object getaccounttypeHandler(String username, String accountnumber) {

    try {
      sql.getConnection();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    try {
      Object obj = null;
      obj = sql.readAccountType(username, accountnumber);
      sql.close();
      return obj;
    } catch (Exception e) {
      e.printStackTrace();
    }

    return null;
  }