Java SQL ResultSet Read getResultSetColumns(ResultSet rs)

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

Description

get Result Set Columns

License

Apache License

Declaration

public static String[] getResultSetColumns(ResultSet rs) throws SQLException 

Method Source Code

//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);
    }
}

Related

  1. getResultSet(Connection c, String query)
  2. getResultSet(Connection conn, String query)
  3. getResultSet(Connection connection, String query)
  4. getResultSet(String sql)
  5. getResultSetColnumNames(ResultSet rs)
  6. getResultSetDateValue(ResultSet rs, String sColumnName)
  7. GetResultSetFromQuery(String command)
  8. getResultSetFromQueryAgainstDefaultConnection( String sql)
  9. getResultSetInstance(Connection conn, String sql)