commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wspe...@apache.org
Subject svn commit: r1482051 - in /commons/proper/dbutils/trunk/src: changes/changes.xml main/java/org/apache/commons/dbutils/BasicRowProcessor.java
Date Mon, 13 May 2013 19:55:25 GMT
Author: wspeirs
Date: Mon May 13 19:55:25 2013
New Revision: 1482051

URL: http://svn.apache.org/r1482051
Log:
Applied fix for DBUTILS-100 and added to changes.xml file

Modified:
    commons/proper/dbutils/trunk/src/changes/changes.xml
    commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java

Modified: commons/proper/dbutils/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/changes/changes.xml?rev=1482051&r1=1482050&r2=1482051&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbutils/trunk/src/changes/changes.xml Mon May 13 19:55:25 2013
@@ -50,6 +50,9 @@ The <action> type attribute can be add,u
       <action dev="wspeirs" due-to="PB" type="add" issue="DBUTILS-107">
         Patch QueryLoader to also load from XML properties files
       </action>
+      <action dev="wspeirs" due-to="xiaofei.xu" type="fix" issue="DBUTILS-100">
+        Updated the use of getColumnName to try getColumnLabel first
+      </action>
       <action dev="simonetripodi" due-to="Moandji Ezana" type="add" issue="DBUTILS-98">
         Add missing JavaDoc to QueryRunner#insert
       </action>

Modified: commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java?rev=1482051&r1=1482050&r2=1482051&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
(original)
+++ commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
Mon May 13 19:55:25 2013
@@ -156,7 +156,11 @@ public class BasicRowProcessor implement
         int cols = rsmd.getColumnCount();
 
         for (int i = 1; i <= cols; i++) {
-            result.put(rsmd.getColumnName(i), rs.getObject(i));
+            String columnName = rsmd.getColumnLabel(i);
+            if (null == columnName || 0 == columnName.length()) {
+              columnName = rsmd.getColumnName(i);
+            }
+            result.put(columnName, rs.getObject(i));
         }
 
         return result;



Mime
View raw message