Here you can find the source of arrayOfResult(ResultSet rs)
private static String[] arrayOfResult(ResultSet rs) throws SQLException
//package com.java2s; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; public class Main { private static String[] arrayOfResult(ResultSet rs) throws SQLException { ResultSetMetaData rsm = rs.getMetaData(); String ret[] = new String[rsm.getColumnCount()]; for (int i = 0; i < ret.length; i++) { ret[i] = rs.getString(i + 1); }//from w w w . j a v a 2 s .co m return ret; } }