Search in sources :

Example 1 with CaseInsensitiveMap

use of org.apache.commons.collections4.map.CaseInsensitiveMap in project sharding-jdbc by dangdangdotcom.

the class AbstractResultSetAdapter method generateColumnLabelIndexMap.

private Map<String, Integer> generateColumnLabelIndexMap() throws SQLException {
    ResultSetMetaData resultSetMetaData = resultSets.get(0).getMetaData();
    Map<String, Integer> result = new CaseInsensitiveMap<>(resultSetMetaData.getColumnCount());
    for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
        result.put(resultSetMetaData.getColumnLabel(i), i);
    }
    return result;
}
Also used : ResultSetMetaData(java.sql.ResultSetMetaData) CaseInsensitiveMap(org.apache.commons.collections4.map.CaseInsensitiveMap)

Aggregations

ResultSetMetaData (java.sql.ResultSetMetaData)1 CaseInsensitiveMap (org.apache.commons.collections4.map.CaseInsensitiveMap)1