get column count jdbc

Solutions on MaxInterview for get column count jdbc by the best coders in the world

showing results for - "get column count jdbc"
Maybell
17 Jun 2020
1/**
2     * Get the column count
3     * @return count of column the result set have
4     */
5    public static int getColumnCount(){
6
7        int columnCount = 0;
8
9        try {
10            ResultSetMetaData rsMetaData = rs.getMetaData();
11            columnCount = rsMetaData.getColumnCount();
12        } catch (SQLException e) {
13            System.out.println("ERROW WHILE GETTING COLUMN COUNT " +e.getMessage());
14        }
15        return columnCount;
16    }