Skip to content

Conversation

@liony
Copy link

@liony liony commented Jan 30, 2019

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

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

for (int col = 1; col <= cols; col++) {
String columnName = rsmd.getColumnLabel(col);
if (null == columnName || 0 == columnName.length()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using "columnName.isEmpty()" instead of "0 == columnName.length()"
May you please add a unit test?

Copy link
Member

@garydgregory garydgregory Mar 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole patch seems redundant with what JDBC specifies as the behavior for getColumnLabel(). What am I missing? This patch is workaround for buggy JDBC drivers?

VanniMaceria added a commit to VanniMaceria/progetto-software-dependability that referenced this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants