Here you can find the source of getResultSetColumns(ResultSet rs)
public static String[] getResultSetColumns(ResultSet rs) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.*; public class Main { public static String[] getResultSetColumns(ResultSet rs) throws SQLException { ResultSetMetaData md = rs.getMetaData(); int nCols = md.getColumnCount(); String[] ret = new String[nCols]; for (int i = 0; i < ret.length; i++) { ret[i] = md.getColumnName(i + 1); }/* w w w .ja v a2 s. c om*/ return (ret); } }