public static int getColumnIndex(final String key, final MetaData columnMD, final String colName, final boolean columNameCaseSensitive) {
        int idx = -1;
        String column = colName;
        if (!columNameCaseSensitive) {
            column = colName.toLowerCase(Locale.getDefault());
        }
        idx = columnMD.getColumnIndex(key, column);

        if (idx < 0) {
            throw new NoSuchElementException(
                    "Column [" + column + "] does not exist, check case/spelling." + (key != null ? " key:[" + key + "]" : ""));
        }
        return idx;
    }