ResultSetMetaData md = rs.getMetaData();
int cols = md.getColumnCount();
for (int i = 1; i <= cols; i++) {
print(md.getColumnName(i) + "\t");
}
println();
while (rs.next()) {
for (int i = 1; i <= cols; i++) {
print(rs.getString(i) + "\t");
}
println();
}