Java SQL ResultSet Read getRsCloumns(ResultSet rs)

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

Description

get Rs Cloumns

License

Apache License

Declaration

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

Method Source Code


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

Related

  1. getRow(ResultSet rs)
  2. getRowCount(final ResultSet rs)
  3. getRowCount(ResultSet set)
  4. getRows(final ResultSet rs)
  5. getRows(ResultSet table)
  6. getRSData(ResultSet rs, String columnName, int jdbcType)
  7. getStatement(ResultSet resultSet)
  8. getURI(ResultSet resultSet, String columnLabel)
  9. getURI(ResultSet rs, int col)