private void processData ( final ResultSet rs , List < DataListener > listeners ) { try { ResultSetMetaData rsmd = rs . getMetaData ( ) ; int colCount = rsmd . getColumnCount ( ) ; int i = 0 ; while ( rs . next ( ) ) { newRow ( listeners , i , colCount ) ; for ( int cellNum = 1 ; cellNum < colCount + 1 ; cellNum ++ ) { String cell ; int sqlType = rsmd . getColumnType ( cellNum ) ; switch ( sqlType ) { case java . sql . Types . DATE : cell = rs . getDate ( cellNum ) . toString ( ) ; break ; case java . sql . Types . INTEGER : case java . sql . Types . DOUBLE : cell = String . valueOf ( rs . getInt ( cellNum ) ) ; break ; default : cell = rs . getString ( cellNum ) ; } newCell ( listeners , i , cellNum - 1 , cell , DataListener . NON_MERGED ) ; } i ++ ; } } catch ( SQLException e ) { //TODO: you need to throw or handle } finishData ( listeners ) ; }
Iterate through the resultset .