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