Interface ColumnAliasExtractor


  • public interface ColumnAliasExtractor
    Strategy for extracting the unique column alias out of a ResultSetMetaData. This is used during the "auto discovery" phase of native SQL queries.

    Generally this should be done via ResultSetMetaData.getColumnLabel(int), but not all drivers do this correctly.

    • Field Detail

      • COLUMN_LABEL_EXTRACTOR

        static final ColumnAliasExtractor COLUMN_LABEL_EXTRACTOR
        An extractor which uses ResultSetMetaData.getColumnLabel(int)
      • COLUMN_NAME_EXTRACTOR

        static final ColumnAliasExtractor COLUMN_NAME_EXTRACTOR
        An extractor which uses ResultSetMetaData.getColumnName(int)
    • Method Detail

      • extractColumnAlias

        java.lang.String extractColumnAlias​(java.sql.ResultSetMetaData metaData,
                                            int position)
                                     throws java.sql.SQLException
        Extract the unique column alias.
        Parameters:
        metaData - The result set metadata
        position - The column position
        Returns:
        The alias
        Throws:
        java.sql.SQLException - Indicates a problem accessing the JDBC ResultSetMetaData