1 | //result set or hit list is obtained after |
2 | // executing the query |
3 | //and using a cursor it is displayed |
4 | ResultSet rs = stmt.getResultSet ( ); |
5 | while (rs.next () ) { |
6 | System.out.println( rs.getString(1) + "-" + |
7 | rs.getString(2) + "-" + rs.getString(3) ); |
8 | } |
9 | //get the metadata using the result set |
10 | ResultSetMetaData rsmd = rs.getMetaData (); |
11 | System.out.println("Number of Columns:" |
12 | + rsmd.getColumnCount() ); |