Java SQL ResultSet fillRowNames(Map metaData, ResultSet rs)

Here you can find the source of fillRowNames(Map metaData, ResultSet rs)

Description

fill Row Names

License

Apache License

Declaration

private static void fillRowNames(Map<String, Integer> metaData, ResultSet rs) throws SQLException 

Method Source Code


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

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

import java.util.Map;
import org.springframework.util.Assert;

public class Main {
    private static void fillRowNames(Map<String, Integer> metaData, ResultSet rs) throws SQLException {
        Assert.notNull(metaData, "The column names can't be null.");
        if (metaData.isEmpty()) {
            for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
                metaData.put(rs.getMetaData().getColumnName(i), rs.getMetaData().getColumnType(i));
            }/*from   w w  w .ja  v a 2  s  . c o m*/
        }
    }
}

Related

  1. encodeHeader(ResultSetMetaData metaData)
  2. extractGeneratedId(ResultSet generatedKeys)
  3. extractIntResult(ResultSet rs, ResultSetMetaData rsmd, int index)
  4. extractResults(ResultSet resultSet)
  5. extractResultSetFiledNames(ResultSet result)
  6. hasCompleted(ResultSet rs)
  7. hasGeometryField(ResultSet resultSet)
  8. isNull(ResultSet rs, String name)
  9. isResultEmpty(ResultSet theResult)