File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -99,7 +99,12 @@ public ResultSetWrappingSqlRowSet(ResultSet resultSet) throws InvalidResultSetAc
99
99
int columnCount = rsmd .getColumnCount ();
100
100
this .columnLabelMap = new HashMap <String , Integer >(columnCount );
101
101
for (int i = 1 ; i <= columnCount ; i ++) {
102
- this .columnLabelMap .put (rsmd .getColumnLabel (i ), i );
102
+ String key = rsmd .getColumnLabel (i );
103
+ // Make sure to preserve first matching column for any given name,
104
+ // as defined in ResultSet's type-level javadoc (lines 81 to 83).
105
+ if (!this .columnLabelMap .containsKey (key )) {
106
+ this .columnLabelMap .put (key , i );
107
+ }
103
108
}
104
109
}
105
110
else {
You can’t perform that action at this time.
0 commit comments