spring-framework / org.springframework.jdbc.support / JdbcUtils / lookupColumnName

lookupColumnName

open static fun lookupColumnName(resultSetMetaData: ResultSetMetaData, columnIndex: Int): String

Determine the column name to use. The column name is determined based on a lookup using ResultSetMetaData.

This method implementation takes into account recent clarifications expressed in the JDBC 4.0 specification:

columnLabel - the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.

Parameters

resultSetMetaData - the current meta data to use

columnIndex - the index of the column for the look up

Exceptions

SQLException - in case of lookup failure

Return
the column name to use