Java SQL ResultSet Read getNumberColumns(ResultSet rs)

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

Description

get Number Columns

License

Apache License

Declaration

public static int getNumberColumns(ResultSet rs) throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.*;

public class Main {
    public static int getNumberColumns(ResultSet rs) throws SQLException {
        ResultSetMetaData md = rs.getMetaData();
        int nCols = md.getColumnCount();
        return (nCols);
    }//from ww  w .ja v  a 2 s  .c om
}

Related

  1. getNullableByte(ResultSet resultSet, String columnLabel)
  2. getNullableInt(ResultSet resultSet, String column, int fallback)
  3. getNullableLong(ResultSet rs, String columnName)
  4. getNullDate(ResultSet result, String columnName)
  5. getNumber(ResultSet rs, String name)
  6. getNumRows(ResultSet query)
  7. getObject(ResultSet resultSet, int columnCount, Map columnLabelMap, String[] fields, String[] columnLabel, Class cls, Boolean flag)
  8. getObject(ResultSet rs, int columnIndex, Class type)
  9. getObject(ResultSet set, int columnIndex)