public static int updateClient(Client client) throws ClassNotFoundException, SQLException {
    try {
      readWriteLock.writeLock().lock();

      Connection conn = DBConnection.getDBConnection().getConnection();
      String sql =
          "Update  Client Set  clientName='"
              + client.getClientName()
              + "', Birthday='"
              + client.getBirthday()
              + "',Telephone='"
              + client.getTelephone()
              + "', Address='"
              + client.getAddress()
              + "', AnnualIncome='"
              + client.getAnnualIncome()
              + "', GrantOwnershipPosition='"
              + client.getGrantOwnershipPosition()
              + "',PermitOwnershipPosition='"
              + client.getPermitOwnershipPosition()
              + "',MarriedStatus='"
              + client.isMarried()
              + "',NumberOfMarriedSons='"
              + client.getNumberOfMarriedSons()
              + "',NumberOfUnmarriedSons='"
              + client.getNumberOfUnmarriedSons()
              + "' Where NIC ='"
              + client.getNIC()
              + "'";
      int res = DBHandler.setData(conn, sql);
      return res;
    } finally {
      readWriteLock.writeLock().unlock();
    }
  }
 public static boolean DeleteNominatedSuccessor(String nic)
     throws ClassNotFoundException, SQLException {
   Connection conn = DBConnection.getDBConnection().getConnection();
   String sql = "Delete  from nominatedSuccessor where NIC_S = '" + nic + "'";
   int returnDelete = DBHandler.setData(conn, sql);
   return returnDelete > 0;
 }
 public static boolean updateNiminateSuccessor(NominatedSuccessor nominateSuccessor)
     throws ClassNotFoundException, SQLException {
   Connection conn = DBConnection.getDBConnection().getConnection();
   String sql =
       "Update  nominatedsuccessor Set  Name='"
           + nominateSuccessor.getName()
           + "', Address='"
           + nominateSuccessor.getAddress()
           + "' Where NIC_S ='"
           + nominateSuccessor.getNIC_S()
           + "'";
   int res = DBHandler.setData(conn, sql);
   return res > 0;
 }
  public static boolean addNewNominateSuccessor(NominatedSuccessor NOS)
      throws ClassNotFoundException, SQLException {

    Connection conn = DBConnection.getDBConnection().getConnection();
    String sql =
        "Insert into nominatedsuccessor Values('"
            + NOS.getName()
            + "','"
            + NOS.getNIC_S()
            + "','"
            + NOS.getAddress()
            + "')";
    int returnValue = DBHandler.setData(conn, sql);
    return returnValue > 0;
  }
  public static boolean addNewClient(Client client) throws ClassNotFoundException, SQLException {
    try {
      readWriteLock.writeLock().lock();
      Connection conn = DBConnection.getDBConnection().getConnection();
      String sql =
          "Insert into Client Values('"
              + client.getRegNo()
              + "','"
              + client.getNIC()
              + "','"
              + client.getClientName()
              + "','"
              + client.getBirthday()
              + "','"
              + client.getTelephone()
              + "','"
              + client.getAddress()
              + "','"
              + client.getAnnualIncome()
              + "','"
              + client.getGrantOwnershipPosition()
              + "','"
              + client.getPermitOwnershipPosition()
              + "','"
              + client.isMarried()
              + "','"
              + client.getNumberOfMarriedSons()
              + "','"
              + client.getNumberOfUnmarriedSons()
              + "')";
      int returnValue = DBHandler.setData(conn, sql);

      return returnValue > 0;

    } finally {
      readWriteLock.writeLock().unlock();
    }
  }