Example #1
0
  public boolean retrieveYesNoResult(String condition) {
    boolean success = false;
    ResultSet rs = null;

    String dbQuery = "SELECT * FROM saharp5_adeel_school.YesNo_Result";

    if (condition != null) {
      dbQuery += condition;
    }

    rs = db.readRequest(dbQuery);

    try {
      while (rs.next()) {
        setCode(rs.getInt("frCode"));
        fqCode.add(rs.getInt("fqCode"));
        trueFalse.add(rs.getBoolean("result"));
        success = true;
      }

    } catch (Exception e) {
      e.printStackTrace();
    }

    return success;
  }
Example #2
0
  public boolean createYesNoResult(int frCode, int fqCode, boolean result) {
    boolean success = false;

    String sql = "INSERT INTO saharp5_adeel_school.YesNo_Result(frCode, fqCode, result) ";
    sql += "VALUES (" + frCode + ", " + fqCode + ", " + result + ")";

    if (db.updateRequest(sql) == 1) success = true;

    return success;
  }