void queryReadResult(PreparedStatement prep) throws SQLException {
  ResultSet rs=prep.executeQuery();
  ResultSetMetaData meta=rs.getMetaData();
  int columnCount=meta.getColumnCount();
  while (rs.next()) {
    for (int i=0; i < columnCount; i++) {
      rs.getString(i + 1);
    }
  }
}

void queryReadResult ( PreparedStatement prep ) throws SQLException { ResultSet rs = prep . executeQuery ( ) ; ResultSetMetaData meta = rs . getMetaData ( ) ; int columnCount = meta . getColumnCount ( ) ; while ( rs . next ( ) ) { for ( int i = 0 ; i < columnCount ; i ++ ) { rs . getString ( i + 1 ) ; } } }
execute a query and read all rows .
