Interface IPentahoConnection


  • public interface IPentahoConnection
    A PentahoConnection represents metadata and functions required to execute queries against data sources. It also contains constants that are properties in data components SQLLookupRule and MDXLookupRule.
    Author:
    wseyler
    See Also:
    SQLLookupRule, MDXLookupRule
    • Method Detail

      • setProperties

        void setProperties​(Properties props)
        Sets the properties to be used when the connection is made. The standard keys for the properties are defined in this interface.
        Parameters:
        props - Properties to be used when the connection is made.
      • close

        void close()
        Closes the connection.
      • getLastQuery

        String getLastQuery()
        Retrieves the string representation of the last executed query.
        Returns:
        Returns the last query string executed.
      • executeQuery

        IPentahoResultSet executeQuery​(String query)
                                throws Exception
        Executes the specified query against the connection.
        Parameters:
        query - SQL-like query string. May be data source specific.
        Returns:
        Returns the result set of the query.
        Throws:
        Exception
      • prepareAndExecuteQuery

        IPentahoResultSet prepareAndExecuteQuery​(String query,
                                                 List parameters)
                                          throws Exception
        Builds the query based on the pattern and parameters list and executes it against the connection.
        Parameters:
        query - SQL-like query string. May be data source specific.
        parameters - List of objects to bind into prepared query.
        Returns:
        Returns result set of the query.
        Throws:
        Exception
      • preparedQueriesSupported

        boolean preparedQueriesSupported()
        Checks if the given connection supports prepared queries.
        Returns:
        Returns true if the connection supports prepared queries.
      • getResultSet

        IPentahoResultSet getResultSet()
        Returns resultset of the last executed query.
        Returns:
        Returns the resultset from the last query executed.
      • isClosed

        boolean isClosed()
        Checks if the connection is closed or not.
        Returns:
        Returns true if this connection has been closed.
      • isReadOnly

        boolean isReadOnly()
        Checks if the connection is read only or not.
        Returns:
        true if this connection is read only. NOTE: Current implementation for all connections is read only.
      • clearWarnings

        void clearWarnings()
        Clears any warnings cached by the connection.
      • connect

        boolean connect​(Properties props)
        Connects to the data source using the supplied properties.
        Parameters:
        props - Data source connection properties.
        Returns:
        Returns true if the connection was successful.
      • setMaxRows

        void setMaxRows​(int maxRows)
        Sets maximum rows that will be returned by the next query.
        Parameters:
        maxRows - Maximum rows that are returned by the next query.
      • setFetchSize

        void setFetchSize​(int fetchSize)
        Sets size of the fetch buffer used when retrieving rows from the underlying database.
        Parameters:
        fetchSize - The size of the buffer.
      • initialized

        boolean initialized()
        Checks if the connection is initialized or not.
        Returns:
        Return true if the connection has been properly initialized.
      • getDatasourceType

        String getDatasourceType()
        Returns the connection type.
        Returns:
        Returns the type of the connection.