Class JDBCExecutionFactory

    • Field Detail

      • DEFAULT_MAX_IN_CRITERIA

        public static final int DEFAULT_MAX_IN_CRITERIA
        See Also:
        Constant Field Values
      • DEFAULT_MAX_DEPENDENT_PREDICATES

        public static final int DEFAULT_MAX_DEPENDENT_PREDICATES
        See Also:
        Constant Field Values
      • DEFAULT_TIME_ZONE

        public static final TimeZone DEFAULT_TIME_ZONE
    • Constructor Detail

      • JDBCExecutionFactory

        public JDBCExecutionFactory()
    • Method Detail

      • start

        public void start()
                   throws org.teiid.translator.TranslatorException
        Overrides:
        start in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
        Throws:
        org.teiid.translator.TranslatorException
      • getDatabaseVersion

        @TranslatorProperty(display="Database Version",
                            description="Database Version")
        public String getDatabaseVersion()
      • setDatabaseVersion

        public void setDatabaseVersion​(String version)
        Sets the database version. See also getVersion()
        Parameters:
        version -
      • setDatabaseVersion

        public void setDatabaseVersion​(org.teiid.util.Version version)
      • getVersion

        protected org.teiid.util.Version getVersion()
        Get the database version as a comparable object
        Returns:
      • useBindVariables

        @TranslatorProperty(display="Use Bind Variables",
                            description="Use prepared statements and bind variables",
                            advanced=true)
        public boolean useBindVariables()
      • setUseBindVariables

        public void setUseBindVariables​(boolean useBindVariables)
      • getDatabaseTimeZone

        @TranslatorProperty(display="Database time zone",
                            description="Time zone of the database, if different than Integration Server",
                            advanced=true)
        public String getDatabaseTimeZone()
      • setDatabaseTimeZone

        public void setDatabaseTimeZone​(String databaseTimeZone)
      • isTrimStrings

        @TranslatorProperty(display="Trim string flag",
                            description="Right Trim fixed character types returned as Strings - note that the native type must be char or nchar and the source must support the rtrim function.",
                            advanced=true)
        public boolean isTrimStrings()
      • setTrimStrings

        public void setTrimStrings​(boolean trimStrings)
      • useCommentsInSourceQuery

        @TranslatorProperty(display="Use informational comments in Source Queries",
                            description="This will embed a /*comment*/ leading comment with session/request id in source SQL query for informational purposes",
                            advanced=true)
        public boolean useCommentsInSourceQuery()
      • setUseCommentsInSourceQuery

        public void setUseCommentsInSourceQuery​(boolean useCommentsInSourceQuery)
      • isSourceRequired

        public boolean isSourceRequired()
        Overrides:
        isSourceRequired in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • isSourceRequiredForCapabilities

        public boolean isSourceRequiredForCapabilities()
        Overrides:
        isSourceRequiredForCapabilities in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • usesDatabaseVersion

        protected boolean usesDatabaseVersion()
      • initCapabilities

        public void initCapabilities​(Connection connection)
                              throws org.teiid.translator.TranslatorException
        Overrides:
        initCapabilities in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
        Throws:
        org.teiid.translator.TranslatorException
      • createResultSetExecution

        public org.teiid.translator.ResultSetExecution createResultSetExecution​(org.teiid.language.QueryExpression command,
                                                                                org.teiid.translator.ExecutionContext executionContext,
                                                                                org.teiid.metadata.RuntimeMetadata metadata,
                                                                                Connection conn)
                                                                         throws org.teiid.translator.TranslatorException
        Overrides:
        createResultSetExecution in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
        Throws:
        org.teiid.translator.TranslatorException
      • createDirectExecution

        public org.teiid.translator.ProcedureExecution createDirectExecution​(List<org.teiid.language.Argument> arguments,
                                                                             org.teiid.language.Command command,
                                                                             org.teiid.translator.ExecutionContext executionContext,
                                                                             org.teiid.metadata.RuntimeMetadata metadata,
                                                                             Connection conn)
                                                                      throws org.teiid.translator.TranslatorException
        Overrides:
        createDirectExecution in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
        Throws:
        org.teiid.translator.TranslatorException
      • createProcedureExecution

        public org.teiid.translator.ProcedureExecution createProcedureExecution​(org.teiid.language.Call command,
                                                                                org.teiid.translator.ExecutionContext executionContext,
                                                                                org.teiid.metadata.RuntimeMetadata metadata,
                                                                                Connection conn)
                                                                         throws org.teiid.translator.TranslatorException
        Overrides:
        createProcedureExecution in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
        Throws:
        org.teiid.translator.TranslatorException
      • createUpdateExecution

        public JDBCUpdateExecution createUpdateExecution​(org.teiid.language.Command command,
                                                         org.teiid.translator.ExecutionContext executionContext,
                                                         org.teiid.metadata.RuntimeMetadata metadata,
                                                         Connection conn)
                                                  throws org.teiid.translator.TranslatorException
        Overrides:
        createUpdateExecution in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
        Throws:
        org.teiid.translator.TranslatorException
      • getConnection

        public Connection getConnection​(DataSource ds)
                                 throws org.teiid.translator.TranslatorException
        Overrides:
        getConnection in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
        Throws:
        org.teiid.translator.TranslatorException
      • getMetadata

        public void getMetadata​(org.teiid.metadata.MetadataFactory metadataFactory,
                                Connection conn)
                         throws org.teiid.translator.TranslatorException
        Overrides:
        getMetadata in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
        Throws:
        org.teiid.translator.TranslatorException
      • getMetadataProcessor

        public org.teiid.translator.MetadataProcessor<Connection> getMetadataProcessor()
        Overrides:
        getMetadataProcessor in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • getSupportedFunctions

        public List<String> getSupportedFunctions()
        Overrides:
        getSupportedFunctions in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • getDefaultSupportedFunctions

        public List<String> getDefaultSupportedFunctions()
      • supportsGroupBy

        public boolean supportsGroupBy()
        Overrides:
        supportsGroupBy in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsAggregatesAvg

        public boolean supportsAggregatesAvg()
        Overrides:
        supportsAggregatesAvg in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsAggregatesCount

        public boolean supportsAggregatesCount()
        Overrides:
        supportsAggregatesCount in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsAggregatesCountStar

        public boolean supportsAggregatesCountStar()
        Overrides:
        supportsAggregatesCountStar in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsAggregatesDistinct

        public boolean supportsAggregatesDistinct()
        Overrides:
        supportsAggregatesDistinct in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsAggregatesMax

        public boolean supportsAggregatesMax()
        Overrides:
        supportsAggregatesMax in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsAggregatesMin

        public boolean supportsAggregatesMin()
        Overrides:
        supportsAggregatesMin in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsAggregatesSum

        public boolean supportsAggregatesSum()
        Overrides:
        supportsAggregatesSum in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsAliasedTable

        public boolean supportsAliasedTable()
        Overrides:
        supportsAliasedTable in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsCompareCriteriaEquals

        public boolean supportsCompareCriteriaEquals()
        Overrides:
        supportsCompareCriteriaEquals in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsCorrelatedSubqueries

        public boolean supportsCorrelatedSubqueries()
        Overrides:
        supportsCorrelatedSubqueries in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsExistsCriteria

        public boolean supportsExistsCriteria()
        Overrides:
        supportsExistsCriteria in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsInCriteria

        public boolean supportsInCriteria()
        Overrides:
        supportsInCriteria in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsInCriteriaSubquery

        public boolean supportsInCriteriaSubquery()
        Overrides:
        supportsInCriteriaSubquery in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsIsNullCriteria

        public boolean supportsIsNullCriteria()
        Overrides:
        supportsIsNullCriteria in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsLikeCriteria

        public boolean supportsLikeCriteria()
        Overrides:
        supportsLikeCriteria in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsLikeCriteriaEscapeCharacter

        public boolean supportsLikeCriteriaEscapeCharacter()
        Overrides:
        supportsLikeCriteriaEscapeCharacter in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsNotCriteria

        public boolean supportsNotCriteria()
        Overrides:
        supportsNotCriteria in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsOrCriteria

        public boolean supportsOrCriteria()
        Overrides:
        supportsOrCriteria in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsOrderByUnrelated

        public boolean supportsOrderByUnrelated()
        Overrides:
        supportsOrderByUnrelated in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsQuantifiedCompareCriteriaAll

        public boolean supportsQuantifiedCompareCriteriaAll()
        Overrides:
        supportsQuantifiedCompareCriteriaAll in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsScalarSubqueries

        public boolean supportsScalarSubqueries()
        Overrides:
        supportsScalarSubqueries in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsSearchedCaseExpressions

        public boolean supportsSearchedCaseExpressions()
        Overrides:
        supportsSearchedCaseExpressions in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsSelfJoins

        public boolean supportsSelfJoins()
        Overrides:
        supportsSelfJoins in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsInlineViews

        public boolean supportsInlineViews()
        Overrides:
        supportsInlineViews in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsQuantifiedCompareCriteriaSome

        public boolean supportsQuantifiedCompareCriteriaSome()
        Overrides:
        supportsQuantifiedCompareCriteriaSome in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsSetQueryOrderBy

        public boolean supportsSetQueryOrderBy()
        Overrides:
        supportsSetQueryOrderBy in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsUnions

        public boolean supportsUnions()
        Overrides:
        supportsUnions in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsBulkUpdate

        public boolean supportsBulkUpdate()
        Overrides:
        supportsBulkUpdate in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsBatchedUpdates

        public boolean supportsBatchedUpdates()
        Overrides:
        supportsBatchedUpdates in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsCompareCriteriaOrdered

        public boolean supportsCompareCriteriaOrdered()
        Overrides:
        supportsCompareCriteriaOrdered in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsHaving

        public boolean supportsHaving()
        Overrides:
        supportsHaving in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsSelectExpression

        public boolean supportsSelectExpression()
        Overrides:
        supportsSelectExpression in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsInsertWithQueryExpression

        public boolean supportsInsertWithQueryExpression()
        Overrides:
        supportsInsertWithQueryExpression in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • getMaxPreparedInsertBatchSize

        @TranslatorProperty(display="Max Prepared Insert Batch Size",
                            description="The max size of a prepared insert batch.  Default 2048.",
                            advanced=true)
        public int getMaxPreparedInsertBatchSize()
        Get the max number of inserts to perform in one batch.
        Returns:
      • setMaxPreparedInsertBatchSize

        public void setMaxPreparedInsertBatchSize​(int maxInsertBatchSize)
      • getDatabaseCalendar

        public Calendar getDatabaseCalendar()
        Gets the database calendar. This will be set to the time zone specified by the property setDatabaseTimeZone(String), or the local time zone if none is specified.
        Returns:
        the database calendar
      • translate

        public List<?> translate​(org.teiid.language.LanguageObject obj,
                                 org.teiid.translator.ExecutionContext context)
        Return a List of translated parts (LanguageObjects and Objects), or null if to rely on the default translation. Override with care.
        Returns:
        list of translated parts
      • supportsBooleanExpressions

        protected boolean supportsBooleanExpressions()
        if boolean expressions are directly supported. will generally be false if there is no boolean datatype
        Returns:
      • translateGeometrySelect

        public org.teiid.language.Expression translateGeometrySelect​(org.teiid.language.Expression expr)
        Translate GEOMETRY column reference into an expression that will return WKB and possibly the SRID.
        Parameters:
        expr -
        Returns:
      • translateGeographySelect

        public org.teiid.language.Expression translateGeographySelect​(org.teiid.language.Expression expr)
        Translate GEOGRAPHY column reference into an expression that will return WKB and possibly the SRID.
        Parameters:
        expr -
        Returns:
      • translateGeometryLiteral

        public List<?> translateGeometryLiteral​(org.teiid.language.Literal l)
        Translate GEOMETRY literal into an expression that will convert to database geometry type.
        Parameters:
        l -
        Returns:
      • translateGeographyLiteral

        public List<?> translateGeographyLiteral​(org.teiid.language.Literal l)
        Translate GEOGRAPHY literal into an expression that will convert to database geography type.
        Parameters:
        l -
        Returns:
      • translateGeometryParameter

        public List<?> translateGeometryParameter​(org.teiid.language.Parameter p)
        Translate GEOMETRY parameter into an expression that will convert to database geometry type.
        Parameters:
        p -
        Returns:
      • translateGeographyParameter

        public List<?> translateGeographyParameter​(org.teiid.language.Parameter p)
        Translate GEOGRAPHY parameter into an expression that will convert to database geography type.
        Parameters:
        p -
        Returns:
      • retrieveGeometryValue

        public Object retrieveGeometryValue​(ResultSet results,
                                            int paramIndex)
                                     throws SQLException
        The default strategy assumes a blob value containing wkb
        Parameters:
        results -
        paramIndex -
        Returns:
        Throws:
        SQLException
      • retrieveGeographyValue

        public Object retrieveGeographyValue​(ResultSet results,
                                             int paramIndex)
                                      throws SQLException
        The default strategy assumes a blob value containing wkb
        Parameters:
        results -
        paramIndex -
        Returns:
        Throws:
        SQLException
      • translateCommand

        public List<?> translateCommand​(org.teiid.language.Command command,
                                        org.teiid.translator.ExecutionContext context)
        Return a List of translated parts (LanguageObjects and Objects), or null if to rely on the default translation.
        Parameters:
        command -
        context -
        Returns:
        a list of translated parts
      • translateLimit

        public List<?> translateLimit​(org.teiid.language.Limit limit,
                                      org.teiid.translator.ExecutionContext context)
        Return a List of translated parts (LanguageObjects and Objects), or null if to rely on the default translation.
        Parameters:
        limit -
        context -
        Returns:
        a list of translated parts
      • getFunctionModifiers

        public Map<String,​FunctionModifier> getFunctionModifiers()
        Return a map of function name to FunctionModifier.
        Returns:
        Map of function name to FunctionModifier.
      • registerFunctionModifier

        public void registerFunctionModifier​(String name,
                                             FunctionModifier modifier)
        Add the FunctionModifier to the set of known modifiers.
        Parameters:
        name -
        modifier -
      • translateLiteralBoolean

        public String translateLiteralBoolean​(Boolean booleanValue)
        Subclasses should override this method to provide a different sql translation of the literal boolean value. By default, a boolean literal is represented as: '0' or '1'.
        Parameters:
        booleanValue - Boolean value, never null
        Returns:
        Translated string
      • translateLiteralDate

        public String translateLiteralDate​(Date dateValue)
        Subclasses should override this method to provide a different sql translation of the literal date value. By default, a date literal is represented as: {d '2002-12-31'}
        Parameters:
        dateValue - Date value, never null
        Returns:
        Translated string
      • translateLiteralTime

        public String translateLiteralTime​(Time timeValue)
        Subclasses should override this method to provide a different sql translation of the literal time value. By default, a time literal is represented as: {t '23:59:59'} See hasTimeType() to represent literal times as timestamps.
        Parameters:
        timeValue - Time value, never null
        Returns:
        Translated string
      • translateLiteralTimestamp

        public String translateLiteralTimestamp​(Timestamp timestampValue)
        Subclasses should override this method to provide a different sql translation of the literal timestamp value. By default, a timestamp literal is represented as: {ts '2002-12-31 23:59:59'}. See getTimestampNanoPrecision() to control the literal precision.
        Parameters:
        timestampValue - Timestamp value, never null
        Returns:
        Translated string
      • formatDateValue

        public String formatDateValue​(Date dateObject,
                                      boolean useTimezone)
        Format the dateObject (of type date, time, or timestamp) into a string optionally using the DatabaseTimeZone.
        Parameters:
        dateObject -
        Returns:
        Formatted string
      • formatDateValue

        public String formatDateValue​(Date dateObject)
        Format the dateObject (of type date, time, or timestamp) into a string using the DatabaseTimeZone.
        Parameters:
        dateObject -
        Returns:
        Formatted string
      • translateLiteralBinaryType

        public String translateLiteralBinaryType​(org.teiid.core.types.BinaryType obj)
        Subclasses should override this method to provide a different sql translation of the literal varbinary value. By default, a varbinary literal is represented as: X'hex value'
        Parameters:
        obj - value, never null
        Returns:
        Translated string
      • addSourceComment

        public boolean addSourceComment()
        Returns true to indicate that SQL should include a comment indicating the session and request ids.
      • useAsInGroupAlias

        public boolean useAsInGroupAlias()
        Indicates whether group alias should be of the form "...FROM groupA AS X" or "...FROM groupA X". Certain data sources (such as Oracle) may not support the first form.
        Returns:
        boolean
      • usePreparedStatements

        public boolean usePreparedStatements()
        Use PreparedStatements (or CallableStatements) as appropriate for all commands. Bind values will be determined by Literal.setBindEligible(boolean) can be used to force a literal to be a bind value.
      • useParensForSetQueries

        public boolean useParensForSetQueries()
        Set to true to indicate that every branch of a set query should have parenthesis, i.e. (query) union (query)
        Returns:
        true if parenthesis should be used for each set branch
      • hasTimeType

        public boolean hasTimeType()
        Return false to indicate that time support should be emulated with timestamps.
        Returns:
        true if database has a time type
      • getSetOperationString

        public String getSetOperationString​(org.teiid.language.SetQuery.Operation operation)
        Returns the name for a given SetQuery.Operation
        Parameters:
        operation -
        Returns:
        the name for the set operation
      • getSourceComment

        public String getSourceComment​(org.teiid.translator.ExecutionContext context,
                                       org.teiid.language.Command command)
        Returns the source comment for the given command
        Parameters:
        context -
        command -
        Returns:
        the comment
      • replaceElementName

        public String replaceElementName​(String group,
                                         String element)
        Override to return a name other than the default [group.]element
        Parameters:
        group -
        element -
        Returns:
        thre replacement name
      • getTimestampNanoPrecision

        public int getTimestampNanoPrecision()
        Return the precision of timestamp literals. Defaults to 9.
        Returns:
        digits of timestamp nano precision.
      • executeStoredProcedure

        public ResultSet executeStoredProcedure​(CallableStatement statement,
                                                List<org.teiid.language.Argument> preparedValues,
                                                Class<?> returnType)
                                         throws SQLException
        This is a generic implementation. Because different databases handle stored procedures differently, subclasses should override this method if necessary.
        Throws:
        SQLException
      • registerSpecificTypeOfOutParameter

        protected void registerSpecificTypeOfOutParameter​(CallableStatement statement,
                                                          Class<?> runtimeType,
                                                          int index)
                                                   throws SQLException
        For registering specific output parameter types we need to translate these into the appropriate java.sql.Types output parameters We will need to match these up with the appropriate standard sql types
        Throws:
        SQLException
      • bindValue

        public void bindValue​(PreparedStatement stmt,
                              Object param,
                              Class<?> paramType,
                              int i)
                       throws SQLException
        Sets prepared statement parameter i with param. Performs special handling to translate dates using the database time zone and to translate biginteger, float, and char to JDBC safe objects.
        Parameters:
        stmt -
        param -
        paramType -
        i -
        Throws:
        SQLException
      • useStreamsForLobs

        public boolean useStreamsForLobs()
        If streams should be used for Blob/Clob sets on PreparedStatements
        Returns:
      • retrieveValue

        public Object retrieveValue​(ResultSet results,
                                    int columnIndex,
                                    Class<?> expectedType)
                             throws SQLException
        Retrieve the value on the current resultset row for the given column index.
        Parameters:
        results -
        columnIndex -
        expectedType -
        Returns:
        the value
        Throws:
        SQLException
      • retrieveValue

        public Object retrieveValue​(CallableStatement results,
                                    int parameterIndex,
                                    Class<?> expectedType)
                             throws SQLException
        Retrieve the value for the given parameter index
        Parameters:
        results -
        parameterIndex -
        expectedType -
        Returns:
        the value
        Throws:
        SQLException
      • afterInitialConnectionObtained

        protected void afterInitialConnectionObtained​(Connection connection)
        Called exactly once for this source.
        Parameters:
        connection -
      • obtainedConnection

        public void obtainedConnection​(Connection connection)
        Provides a hook to call source specific logic when a connection is obtained. defect request 13979 & 13978
      • useParensForJoins

        public boolean useParensForJoins()
        Set to true to indicate that every branch of a join should have parenthesis.
        Returns:
        true if every branch of a join should use parenthesis
      • getDefaultNullOrder

        public org.teiid.translator.ExecutionFactory.NullOrder getDefaultNullOrder()
        Overrides:
        getDefaultNullOrder in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • useSelectLimit

        public boolean useSelectLimit()
        Returns whether the limit clause is applied to the select clause.
        Returns:
        true if the limit clause is part of the select
      • getLikeRegexString

        public String getLikeRegexString()
        Get the predicate name for LIKE_REGEX
        Returns:
      • setFetchSize

        public void setFetchSize​(org.teiid.language.Command command,
                                 org.teiid.translator.ExecutionContext context,
                                 Statement statement,
                                 int fetchSize)
                          throws SQLException
        Set the fetch size on the given statement.
        Parameters:
        context -
        command -
        statement -
        fetchSize -
        Throws:
        SQLException
      • supportsGeneratedKeys

        public boolean supportsGeneratedKeys()
      • getStructRetrieval

        @TranslatorProperty(display="Struct retrieval",
                            description="Struct retrieval mode (OBJECT, COPY, ARRAY)",
                            advanced=true)
        public JDBCExecutionFactory.StructRetrieval getStructRetrieval()
      • supportsGeneratedKeys

        protected boolean supportsGeneratedKeys​(org.teiid.translator.ExecutionContext context,
                                                org.teiid.language.Command command)
        Parameters:
        context -
        command -
        Returns:
        true if generated keys can be returned
      • createTempTable

        public String createTempTable​(String prefix,
                                      List<org.teiid.language.ColumnReference> cols,
                                      org.teiid.translator.ExecutionContext context,
                                      Connection connection)
                               throws SQLException
        Create a temp table with the given name prefix and columns
        Parameters:
        prefix -
        cols -
        context -
        connection -
        Returns:
        the name of the table created
        Throws:
        SQLException
      • getCreateTempTableSQL

        public String getCreateTempTableSQL​(String name,
                                            List<org.teiid.language.ColumnReference> cols,
                                            boolean transactional)
      • getTemporaryTableName

        public String getTemporaryTableName​(String prefix)
        Parameters:
        prefix -
        Returns:
        a valid temporary table name
      • getCreateTemporaryTablePostfix

        public String getCreateTemporaryTablePostfix​(boolean inTransaction)
        Parameters:
        inTransaction -
        Returns:
        the post script for the temp table create
      • getCreateTemporaryTableString

        public String getCreateTemporaryTableString​(boolean inTransaction)
        Parameters:
        inTransaction -
        Returns:
        the temp table creation ddl
      • getHibernateDialectClassName

        public String getHibernateDialectClassName()
      • supportsDependentJoins

        public boolean supportsDependentJoins()
        Overrides:
        supportsDependentJoins in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • supportsFullDependentJoins

        public boolean supportsFullDependentJoins()
        Overrides:
        supportsFullDependentJoins in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • tempTableRequiresTransaction

        public boolean tempTableRequiresTransaction()
      • loadedTemporaryTable

        public void loadedTemporaryTable​(String tableName,
                                         org.teiid.translator.ExecutionContext context,
                                         Connection connection)
                                  throws SQLException
        Called after the temporary table has been loaded
        Parameters:
        tableName -
        context -
        connection -
        Throws:
        SQLException
      • isEnableDependentJoins

        @TranslatorProperty(display="Enable Dependent Joins",
                            description="Enable Dependent Join Pushdown",
                            advanced=true)
        public boolean isEnableDependentJoins()
      • setEnableDependentJoins

        public void setEnableDependentJoins​(boolean enableDependentJoins)
      • useWithRollup

        public boolean useWithRollup()
        Returns:
        true if the rollup syntax is WITH ROLLUP
      • getCommentFormat

        @TranslatorProperty(display="Comment Format",
                            description="Comment format string used with useCommentsInSourceQuery")
        public String getCommentFormat()
      • setCommentFormat

        public void setCommentFormat​(String commentFormat)
      • useScientificNotation

        public boolean useScientificNotation()
        Returns:
        true if scientific notation should be used for float/double types
      • useUnicodePrefix

        public boolean useUnicodePrefix()
        Returns:
        true if the N prefix an N* type binding should be used for strings containing non-ascii characters
      • useNBindingType

        public boolean useNBindingType()
        Returns:
        true if an N type (NVARCHAR, NCLOB) should be used when a non-ascii value is encountered
      • isExtendedAscii

        public boolean isExtendedAscii()
        Returns:
        true if the database code page includes extended characters values in the 128-255 range
      • isNonAscii

        protected boolean isNonAscii​(String val)
        Parameters:
        val -
        Returns:
        true if the string is non-ascii
      • isNonAscii

        protected boolean isNonAscii​(org.teiid.language.Expression obj)
        Parameters:
        obj -
        Returns:
        true if the string expression is possibly non-ascii
      • isCharacterType

        protected boolean isCharacterType​(Class<?> type)
        Parameters:
        type -
        Returns:
        true if type is for characters
      • isNonAsciiFunction

        protected boolean isNonAsciiFunction​(org.teiid.language.Function f)
        Parameters:
        f -
        Returns:
        true if the function is a conversion function to a non-ascii string type An implementation is not required if no such function exists, or the source can handle unicode string using the standard types.
      • intializeConnectionAfterCancel

        public void intializeConnectionAfterCancel​(Connection c)
                                            throws SQLException
        Implemented if the Connection needs initialized after a statement cancel
        Parameters:
        c -
        Throws:
        SQLException
      • useBindingsForDependentJoin

        @TranslatorProperty(display="Use Bindings For Dependent Join",
                            description="If PreparedStatement bindings should be used for dependent join values.")
        public boolean useBindingsForDependentJoin()
        Overrides:
        useBindingsForDependentJoin in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>
      • setUseBindingsForDependentJoin

        public void setUseBindingsForDependentJoin​(boolean useBindingsForDependentJoin)
      • useColumnNamesForGeneratedKeys

        public boolean useColumnNamesForGeneratedKeys()
        Returns:
        true if column names are required to retrieve generated keys
      • getLateralKeyword

        public String getLateralKeyword()
      • getRemovePushdownCharacters

        @TranslatorProperty(display="Remove Pushdown Characters",
                            description="A case-sensitive regular expression of character strings to remove from string values that are pushed down.")
        public String getRemovePushdownCharacters()
      • setRemovePushdownCharacters

        public void setRemovePushdownCharacters​(String removePushdownCharacters)
      • isDefaultTimeZone

        public boolean isDefaultTimeZone()
        Returns:
        true if the translator is using the VM default TimeZone
      • supportsProcedureParameterExpression

        public boolean supportsProcedureParameterExpression()
        Overrides:
        supportsProcedureParameterExpression in class org.teiid.translator.ExecutionFactory<DataSource,​Connection>