From 0fb0aa341f1710833cc905c13b3ad9e64be2340e Mon Sep 17 00:00:00 2001 From: chunweixie Date: Wed, 30 Jan 2019 15:34:43 +0800 Subject: [PATCH] optimize map columns 2 properties code String getColumnLabel(int column) throws SQLException Gets the designated column's suggested title for use in printouts and displays. The suggested title is usually specified by the SQL AS clause. If a SQL AS is not specified, the value returned from getColumnLabel will be the same as the value returned by the getColumnName method. --from jdk1.6 javadoc --- src/main/java/org/apache/commons/dbutils/BeanProcessor.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/org/apache/commons/dbutils/BeanProcessor.java b/src/main/java/org/apache/commons/dbutils/BeanProcessor.java index 0f0b7ce89..2fb2116e3 100644 --- a/src/main/java/org/apache/commons/dbutils/BeanProcessor.java +++ b/src/main/java/org/apache/commons/dbutils/BeanProcessor.java @@ -465,9 +465,6 @@ protected int[] mapColumnsToProperties(final ResultSetMetaData rsmd, for (int col = 1; col <= cols; col++) { String columnName = rsmd.getColumnLabel(col); - if (null == columnName || 0 == columnName.length()) { - columnName = rsmd.getColumnName(col); - } String propertyName = columnToPropertyOverrides.get(columnName); if (propertyName == null) { propertyName = columnName;