공부
[Java] MySQL get column name
승가비
2022. 1. 16. 20:04
728x90
ResultSetMetaData metaData = resultSet.getMetaData();
int count = metaData.getColumnCount(); //number of column
String columnName[] = new String[count];
for (int i = 1; i <= count; i++)
{
columnName[i-1] = metaData.getColumnLabel(i);
System.out.println(columnName[i-1]);
}
https://stackoverflow.com/questions/19094999/java-how-to-get-column-name-on-result-set
Java - How to get Column name on Result Set
Hello I'm trying to make an error when there is no matched student... and it will display like this No matching records found and I want the column name still the same but still not figuring it out...
stackoverflow.com
728x90