In JAVA, you can use retrieve information about resultset using following code.
String str ="select * from table001";
ResultSet rs = st.executeQuery(str);
ResultSetMetaData rsmd = rs.getMetaData();
System.out.println("Number of columns - " + rsmd.getColumnCount());
System.out.println("JAVA data type for Table field 3 - "+rsmd.getColumnClassName(3));
System.out.println("Database Table field 3 type - "+rsmd.getColumnTypeName(3));