Getting All Rows from a Database Table This example retrieves all the rows from a table called ``mytable''. A row in ``mytable'' consists of a string, integer, and floating point number. try { Statement stmt = connection.createStatement(); // Get data using colunm names. ResultSet rs = stmt.executeQuery( "SELECT * FROM mytable"); while (rs.next()) { String s = rs.getString("COL_A"); 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()) { String s = rs.getString(1); int i = rs.getInt(2); float f = rs.getFloat(3); process(s, i, f); } } catch (SQLException e) { }