1 | //display the metadata information like max size. column type name etc. |
2 | for (int i = 1; i <= rsmd.getColumnCount(); i++) { |
3 | System.out.println("Column Name :" + rsmd.getColumnName(i)); |
4 | System.out.println("Nullable :" + rsmd.isNullable(i)); |
5 | System.out.println("Precision :" + rsmd.getPrecision(i)); |
6 | System.out.println("Scale :" + rsmd.getScale(i)); |
7 | System.out.println("Size :" + rsmd.getColumnDisplaySize(i)); |
8 | System.out.println("Column Type :" + rsmd.getColumnType(i)); |
9 | System.out.println("ColType Name :" + rsmd.getColumnTypeName(i)); |
10 | System.out.println(" "); |
11 | } |
12 | //close the query connection states and then close the database connection |
13 | stmt.close(); |
14 | conn.close(); |
15 | } // end main |
16 | } // end myTest class |