Java SQL ResultSet Print printResultSetHeader(ResultSet rs)

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

Description

print Result Set Header

License

Open Source License

Declaration

public static int printResultSetHeader(ResultSet rs)
            throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

public class Main {
    public static int printResultSetHeader(ResultSet rs)
            throws SQLException {
        return printResultSetHeader(rs.getMetaData());
    }/*from  w w w.j a v a  2s . c o  m*/

    public static int printResultSetHeader(ResultSetMetaData metaData)
            throws SQLException {
        int numColumns = metaData.getColumnCount();
        for (int i = 1; i <= numColumns; i++)
            System.out.print(metaData.getColumnLabel(i) + "\t");
        System.out.println("");
        return numColumns;
    }
}

Related

  1. printResultSet(ResultSet rs)
  2. printResultSet(ResultSet rs)
  3. printResultSet(ResultSet rs)
  4. printResultSet(ResultSet rs)
  5. printResultSetColumns(ResultSet rs)
  6. printResultSetMetadata(ResultSetMetaData rsmd, Writer out)
  7. printResultSetRow(ResultSet rs)
  8. printResultsToFile(ResultSet rst, File outFile)
  9. printRow(ResultSet pk)