1 | ... |
2 | Connection conn = DriverManager.getConnection( "jdbc:odbc:sales"); |
3 | Statement stmt = conn.createStatement(); |
4 | ResultSet rs = stmt.executeQuery( "SELECT Name, Sales FROM Customers"); |
5 | while (rs.next()) { |
6 | String name = rs.getString("Name"); |
7 | int sales = rs.getInt("Sales"); |
8 | ... |