Polishing

This commit is contained in:
Juergen Hoeller
2018-06-06 21:31:24 +02:00
parent 7ece0e219e
commit 25559b9e44
4 changed files with 44 additions and 136 deletions

View File

@@ -37,6 +37,7 @@ import org.springframework.jdbc.CannotGetJdbcConnectionException;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.NumberUtils;
import org.springframework.util.StringUtils;
/**
* Generic utility methods for working with JDBC. Mainly for internal use
@@ -452,7 +453,7 @@ public abstract class JdbcUtils {
*/
public static String lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex) throws SQLException {
String name = resultSetMetaData.getColumnLabel(columnIndex);
if (name == null || name.length() < 1) {
if (!StringUtils.hasLength(name)) {
name = resultSetMetaData.getColumnName(columnIndex);
}
return name;