I´m loading data from MySQL DB into Java application. How to define column type? I.e. how to check if it´s varchar, int, etc? I suppose that ´metadata´ might be useful. Any example will be appreciated.
Connection con = getConnection();
Statement statement = con.createStatement();
int rs = statement.executeQuery(q);
ResultSetMetaData meta = rs.getMetaData();
colCount = meta.getColumnCount(); // nr of columns
//...HOW TO GET COLUMN TYPES HERE?
Retrieve the metadata object from your resultset.