1public static List<String> getColumnNames(){
2
3
4 List<String> columnList = new ArrayList<>();
5 try {
6 ResultSetMetaData rsMetaData = rs.getMetaData();
7 for (int colNum = 1; colNum < getColumnCount() ; colNum++) {
8 columnList.add(rsMetaData.getColumnLabel(colNum));
9 }
10 } catch (SQLException e) {
11 System.out.println("ERROR WHILE GETTING COLUMN NAMES "+ e.getMessage());
12 }
13
14 return columnList;
15 }