// Checkout
  public String checkOut(String memno) {
    String res = " ";
    int count = 0;

    try {

      String query = "Select * from customerdetails WHERE membershipno=?";
      ps = con.prepareStatement(query);
      ps.setString(1, memno);
      rs = ps.executeQuery();
      while (rs.next()) {
        count++;
        System.out.println(count);
      }
      CustomerDBConnection c = new CustomerDBConnection();
      // checking if the max allowed count has already been reached in the customerdetails DB
      System.out.println("calculating the movies checkedout....");
      String result2 = c.checkedOutMovies(memno, count);
      // if it hasnt
      if (result2.equals("true")) {
        System.out.println("checking count in cart...");
        // get the count of movies in the cart
        int count_cart = c.checkCart(memno);
        System.out.println(count_cart);
        // compare with the max_allowed
        System.out.println("checking validity for checkout....");
        res = c.checkValidity(memno, count, count_cart);
      }
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try {
        rs.close();
        ps.close();
        // con.close();
      } catch (SQLException e) {
        e.printStackTrace();
      }
    }
    return res;
  }