Here you can find the source of getRsCloumns(ResultSet rs)
public static String[] getRsCloumns(ResultSet rs) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; public class Main { public static String[] getRsCloumns(ResultSet rs) throws SQLException { ResultSetMetaData rsm = rs.getMetaData(); String[] columns = new String[rsm.getColumnCount()]; for (int i = 0; i < columns.length; i++) { columns[i] = rsm.getColumnLabel(i + 1); }// www. ja va 2s . c o m return columns; } }