공부
[Java] MySQL select value
승가비
2022. 1. 10. 20:58
728x90
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
ResultSetMetaData rsmd = rs.getMetaData();
String name = rsmd.getColumnName(1);
https://stackoverflow.com/questions/696782/retrieve-column-names-from-java-sql-resultset
Retrieve column names from java.sql.ResultSet
With java.sql.ResultSet is there a way to get a column's name as a String by using the column's index? I had a look through the API doc but I can't find anything.
stackoverflow.com
728x90