code: public RowSet mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
          final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
          final int maxrows = methodSQL.maxRows();
  
          try {
              CachedRowSetImpl rows = new CachedRowSetImpl();
  
              if (maxrows > 0) {
                  rows.setMaxRows(maxrows);
              }
  
              rows.populate(resultSet);
              return rows;
          } catch (SQLException e) {
              throw new ControlException(e.getMessage(), e);
          }
      }
docs: Map a ResultSet to a RowSet.  Type of RowSet is defined by the SQL annotation for the method.
  
  @param context   A ControlBeanContext instance.
  @param m         Method assoicated with this call.
  @param resultSet Result set to map.
  @param cal       A Calendar instance for resolving date/time values.
  @return A RowSet object.