Class ResultSetMetadataReader


  • public class ResultSetMetadataReader
    extends Object
    This class creates a textual description of the result columns of a push-down query.

    The columns description is necessary to prepare the IMPORT statement in which the push-down query is executed.

    • Constructor Detail

      • ResultSetMetadataReader

        public ResultSetMetadataReader​(Connection connection,
                                       ColumnMetadataReader columnMetadataReader)
        Create a new instance of a ResultSetMetadataReader.
        Parameters:
        connection - connection to the remote data source
        columnMetadataReader - column metadata reader used to translate the column types
    • Method Detail

      • describeColumns

        public String describeColumns​(String query)
        Generate a textual description of the result columns of the push-down query.
        Parameters:
        query - push-down query
        Returns:
        string describing the columns (names and types)
      • getJdbcTypeDescription

        protected static JDBCTypeDescription getJdbcTypeDescription​(ResultSetMetaData metadata,
                                                                    int columnNumber)
                                                             throws SQLException
        Get the jdbc type description from result set metadata.
        Parameters:
        metadata - result set metadata
        columnNumber - column number to read
        Returns:
        JDBC type description
        Throws:
        SQLException - if reading fails