You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by th...@apache.org on 2017/07/07 02:07:02 UTC
[40/58] [abbrv] commons-dbutils git commit: Applied DBUTILS-100 to
2.0 branch
Applied DBUTILS-100 to 2.0 branch
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/dbutils/branches/2_0@1482074 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/commons-dbutils/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbutils/commit/67728b05
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbutils/tree/67728b05
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbutils/diff/67728b05
Branch: refs/heads/2_0
Commit: 67728b059178f5db2a9579e2c183173e2863562f
Parents: f28bd88
Author: Bill Speirs <ws...@apache.org>
Authored: Mon May 13 20:10:53 2013 +0000
Committer: Bill Speirs <ws...@apache.org>
Committed: Mon May 13 20:10:53 2013 +0000
----------------------------------------------------------------------
.../java/org/apache/commons/dbutils2/BasicRowProcessor.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-dbutils/blob/67728b05/src/main/java/org/apache/commons/dbutils2/BasicRowProcessor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbutils2/BasicRowProcessor.java b/src/main/java/org/apache/commons/dbutils2/BasicRowProcessor.java
index 1b66dc9..264bf57 100644
--- a/src/main/java/org/apache/commons/dbutils2/BasicRowProcessor.java
+++ b/src/main/java/org/apache/commons/dbutils2/BasicRowProcessor.java
@@ -142,7 +142,11 @@ public class BasicRowProcessor implements RowProcessor {
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;