handle empty string in findColumn() method

This commit is contained in:
kimminseok
2025-10-09 10:46:27 +09:00
parent 76b57e5d0c
commit f9e95697c8
2 changed files with 4 additions and 5 deletions

View File

@@ -369,6 +369,10 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
@Override
public int findColumn(String columnLabel) throws SQLException {
if (columnLabel == null || columnLabel.isEmpty()) {
throw new SQLException("column name not found");
}
final String[] columnNames = resultSet.getColumnNames();
for (int i = 0; i < columnNames.length; i++) {
if (columnNames[i].equals(columnLabel)) {