Skip to content

Commit b84eb83

Browse files
committed
fix issue #510
1 parent f55f153 commit b84eb83

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/main/java/com/alibaba/druid/pool/ElasticSearchResultSetMetaDataBase.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,24 @@ public ElasticSearchResultSetMetaDataBase(List<String> headers) {
2626
public List<ColumnMetaData> getColumns() {
2727
return columns;
2828
}
29+
30+
@Override
31+
public int findColumn(String columnName) throws SQLException {
32+
ColumnMetaData column;
33+
for (int i = 0; i < columns.size(); ++i) {
34+
column = columns.get(i);
35+
if (column.getColumnName().equals(columnName)) {
36+
return i + 1;
37+
}
38+
}
39+
40+
throw new SQLException("column '" + columnName + "' not found.");
41+
}
2942

3043
@Override
3144
public int getColumnCount() throws SQLException {
3245
return columns.size();
3346
}
3447

35-
48+
3649
}

0 commit comments

Comments
 (0)