public static < E extends Exception , E2 extends Exception > void parse ( final ResultSet rs , long offset , long count , final int processThreadNum , final int queueSize , final Try . Consumer < Object [ ] , E > rowParser , final Try . Runnable < E2 > onComplete ) throws UncheckedSQLException , E , E2 { final Iterator < Object [ ] > iter = new ObjIterator < Object [ ] > ( ) { private final JdbcUtil . BiRecordGetter < Object [ ] , RuntimeException > biFunc = BiRecordGetter . TO_ARRAY ; private List < String > columnLabels = null ; private boolean hasNext ; @ Override public boolean hasNext ( ) { if ( hasNext == false ) { try { hasNext = rs . next ( ) ; } catch ( SQLException e ) { throw new UncheckedSQLException ( e ) ; } } return hasNext ; } @ Override public Object [ ] next ( ) { if ( hasNext ( ) == false ) { throw new NoSuchElementException ( ) ; } hasNext = false ; try { if ( columnLabels == null ) { columnLabels = JdbcUtil . getColumnLabelList ( rs ) ; } return biFunc . apply ( rs , columnLabels ) ; } catch ( SQLException e ) { throw new UncheckedSQLException ( e ) ; } } } ; Iterables . parse ( iter , offset , count , processThreadNum , queueSize , rowParser , onComplete ) ; }
Parse the ResultSet .