code: public static Result toResult(ResultSet rs, int maxRows) {
          try {
              return new ResultImpl(rs, -1, maxRows);
          } catch (SQLException ex) {
              return null;
          }
      }
docs: Converts <code>maxRows</code> of a <code>ResultSet</code> object to a
  <code>Result</code> object.
  
  @param rs      the <code>ResultSet</code> object
  @param maxRows the maximum number of rows to be cached into the <code>Result</code> object.
  @return The <code>Result</code> object created from the <code>ResultSet</code>,
  limited by <code>maxRows</code>