Example usage for javax.sql.rowset JdbcRowSet getMetaData

List of usage examples for javax.sql.rowset JdbcRowSet getMetaData

Introduction

In this page you can find the example usage for javax.sql.rowset JdbcRowSet getMetaData.

Prototype

ResultSetMetaData getMetaData() throws SQLException;

Source Link

Document

Retrieves the number, types and properties of this ResultSet object's columns.

Usage

From source file:com.kumarvv.setl.utils.RowSetUtil.java

/**
 * get meta columns/*from   w  w w.jav a  2  s . c o m*/
 *
 * @param jrs
 * @return
 */
public Map<String, Integer> getMetaColumns(JdbcRowSet jrs) {
    if (jrs == null) {
        return new HashMap<>();
    }

    try {
        return getMetaColumns(jrs.getMetaData());
    } catch (SQLException sqle) {
        Logger.error("error getting metaColumns:", sqle.getMessage());
        Logger.trace(sqle);
        return new HashMap<>();
    }
}