title: FilteredRowSet filters not applying cumulatively
body: <p>I am trying to filter data from my database, which consists of NHL game statistics.  I want to create a FilteredRowSet which holds all of the games between two specific teams.  I have filters to do so, but the filters will not apply cumulatively.  When I apply the second filter, it cancels out the first one. </p>
  
  <p>I have tried implementing many different kinds of filters but I always run into an issue because the teams can be in one of two columns.  I can not figure out a way to check whether both columns satisfy what I am looking for.  </p>
  
  <p>This is the filter I am using</p>
  
  <p>public class TeamFilter implements Predicate {</p>
  
  <pre><code>private int lo;
  private int hi;
  private String colName = null;
  private int colNumber = -1;
  
  public TeamFilter(int lo, int hi, int colNumber) {
      this.lo = lo;
      this.hi = hi;
      this.colNumber = colNumber;
  }
  
  public TeamFilter(int lo, int hi, String colName) {
      this.lo = lo;
      this.hi = hi;
      this.colName = colName;
  }
  
  @Override
  public boolean evaluate(Object value, String columnName) {
      boolean evaluation = true;
      if (columnName.equalsIgnoreCase(this.colName)) {
          int columnValue = ((Integer) value).intValue();
          if ((columnValue == this.lo) || (columnValue == this.hi)) {
              evaluation = true;
          } else {
              evaluation = false;
          }
      }
      return evaluation;
  }
  
  @Override
  public boolean evaluate(Object value, int columnNumber) {
  
      boolean evaluation = true;
  
      if (this.colNumber == columnNumber) {
          int columnValue = ((Integer) value).intValue();
          if ((columnValue == this.lo) || (columnValue == this.hi)) {
              evaluation = true;
          } else {
              evaluation = false;
          }
      }
      return evaluation;
  }
  
  @Override
  public boolean evaluate(RowSet rs) {
  
      CachedRowSet frs = (CachedRowSet) rs;
      boolean evaluation = false;
  
      try {
          int columnValue = -1;
  
          if (this.colNumber &gt; 0) {
              columnValue = frs.getInt(this.colNumber);
          } else if (this.colName != null) {
              columnValue = frs.getInt(this.colName);
          } else {
              return false;
          }
  
          if ((columnValue == this.lo) || (columnValue == this.hi)) {
              evaluation = true;
          }
      } catch (SQLException e) {
          e.printStackTrace();
      } catch (NullPointerException npe) {
          System.err.println("NullPointerException caught");
          return false;
      }
      return evaluation;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This is how I am implementing the filters on to my FilteredRowSet</p>
  
  <pre><code>TeamFilter fltr1 = new TeamFilter(homeID, awayID, 4);
              TeamFilter fltr4 = new TeamFilter(homeID, awayID, 5);
              FilteredRowSet trs = new FilteredRowSetImpl();
              trs.setCommand("SELECT * FROM GAMES");
              trs.setUsername("root");
              trs.setPassword("rootpass");
              trs.setUrl("jdbc:mysql://localhost:3306/" + "testData"
                      + "?useUnicode=true&amp;useJD"
                      + "BCCompliantTimezoneShift=true&amp;useLegacyDatetimeCode=fal"
                      + "se&amp;serverTimezone=EST");
              trs.execute();
  
              // filters the rowset
              trs.beforeFirst();
              trs.setFilter(fltr1);
              while (trs.next()) {
                  System.out.println((long) trs.getDouble("GAMENUMBER") + ", "
                          + trs.getString("HomeTeam") + ", "
                          + trs.getString("AwayTeam") + ", "
                          + trs.getInt("homeID") + ", " + trs.getInt("awayID"));
              }
              System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
              trs.beforeFirst();
              trs.setFilter(fltr4);
              while (trs.next()) {
                  System.out.println((long) trs.getDouble("GAMENUMBER") + ", "
                          + trs.getString("HomeTeam") + ", "
                          + trs.getString("AwayTeam") + ", "
                          + trs.getInt("homeID") + ", " + trs.getInt("awayID"));
              }
  
              trs.beforeFirst();
  </code></pre>
  
  <p>and this is what I get before and after the second filter.  </p>
  
  <p><a href="https://i.stack.imgur.com/HSPln.png" rel="nofollow noreferrer">Output of the FilteredRowSet before and after second filter</a>
  The first filter filters the home team and the second filter filters the away team.  The teams I am looking to find are the New York Rangers and the Dallas Stars. As you can see, once I do the second filter, only games where the away team is one of those two shows up. The first filter is only when the home team is one of those two teams.  The filters will not apply cumulatively, even though that is what the oracle docs say will happen.  What am I missing?</p>