Answers for "GET columns names from sql"

SQL
3

get column name sql server

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'Customers'
Posted by: Guest on December-11-2020
0

get column names

public static List<String> getColumnNames(){


        List<String> columnList = new ArrayList<>();
        try {
            ResultSetMetaData rsMetaData = rs.getMetaData();
            for (int colNum = 1; colNum < getColumnCount()  ; colNum++) {
                columnList.add(rsMetaData.getColumnLabel(colNum));
            }
        } catch (SQLException e) {
       System.out.println("ERROR WHILE GETTING COLUMN NAMES "+ e.getMessage());
        }

        return columnList;
    }
Posted by: Guest on November-30-2020

Code answers related to "GET columns names from sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language