getColumnLabel vs. getColumnName

前端 未结 1 349
孤城傲影
孤城傲影 2020-12-16 10:59

What is the difference between ResultSetMetaData.getColumnLabel and ResultSetMetaData.getColumnName?

Label: Gets the designated column\'s suggested title for use in

1条回答
  •  借酒劲吻你
    2020-12-16 11:28

    String getColumnLabel(int column) throws SQLException;  
    

    If a SQL AS is not specified, the value returned from getColumnLabel will be the same as the value returned by the getColumnName method.

    Example:

    select id as user_no from users
    
    • getColumnLabel would return 'user_no'
    • getColumnName would return 'id'

    0 讨论(0)
提交回复
热议问题