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 ) ; } }
Map a ResultSet to a RowSet . Type of RowSet is defined by the SQL annotation for the method .