Java SQL ResultSet Read getAllColumnNames(ResultSet rs)

Here you can find the source of getAllColumnNames(ResultSet rs)

Description

get All Column Names

License

Open Source License

Declaration

private static List<String> getAllColumnNames(ResultSet rs) throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.ArrayList;

import java.util.List;

public class Main {

    private static List<String> getAllColumnNames(ResultSet rs) throws SQLException {
        List<String> columnNames = new ArrayList<String>();
        if (null != rs) {
            for (int i = 0; i < rs.getMetaData().getColumnCount(); i++) {
                columnNames.add(rs.getMetaData().getColumnName(i + 1));
            }/*from  w  ww.  j  a va  2 s  .  c o  m*/
        }
        return columnNames;
    }
}

Related

  1. get(ResultSet rs, String name)
  2. getAllColumnNamesFromResultSet(ResultSet set)
  3. getAllData(ResultSet rs)
  4. getAllRow(ResultSet rs)
  5. getAllValueMaps(ResultSet input)