try { // Get data using colunm names. "SELECT * FROM mytable"); while (rs.next()) { int i = rs.getInt("COL_B"); float f = rs.getFloat("COL_C"); process(s, i, f); } // Get data using colunm numbers. rs = stmt.executeQuery( "SELECT * FROM mytable"); while (rs.next()) { int i = rs.getInt(2); float f = rs.getFloat(3); process(s, i, f); } }