DatabaseMetaData metadata = connection.getMetaData();
ResultSet rs = metadata.getColumns(null, null, tableName, "%");
while (rs.next()) {
String colName = rs.getString("COLUMN_NAME");
}
ResultSet rs = metadata.getColumns(null, null, tableName, "%");
while (rs.next()) {
String colName = rs.getString("COLUMN_NAME");
}