Class DB2ZPlatform

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, CorePlatform<ConversionManager>, Platform

    public class DB2ZPlatform
    extends DB2Platform
    Purpose: Provides DB2 z/OS specific behavior.

    This provides for some additional compatibility in certain DB2 versions.

    Responsibilities:

    • Support creating tables that handle multibyte characters
    See Also:
    Serialized Form
    • Constructor Detail

      • DB2ZPlatform

        public DB2ZPlatform()
    • Method Detail

      • buildFieldTypes

        protected java.util.Hashtable buildFieldTypes()
        Description copied from class: DatabasePlatform
        Return the mapping of class types to database types for the schema framework.
        Overrides:
        buildFieldTypes in class DB2Platform
      • getTableCreationSuffix

        public java.lang.String getTableCreationSuffix()
        Description copied from class: DatabasePlatform
        PUBLIC: Get the String used on all table creation statements generated from the DefaultTableGenerator with a session using this project (DDL generation). This value will be appended to CreationSuffix strings stored on the DatabaseTable or TableDefinition.
        Overrides:
        getTableCreationSuffix in class DatabasePlatform
      • initializePlatformOperators

        protected void initializePlatformOperators()
        INTERNAL: Initialize any platform-specific operators
        Overrides:
        initializePlatformOperators in class DB2Platform
      • avgOperator

        protected ExpressionOperator avgOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610
      • sumOperator

        protected ExpressionOperator sumOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610
      • absOperator

        protected ExpressionOperator absOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610
      • concatOperator

        protected ExpressionOperator concatOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610
        Overrides:
        concatOperator in class DB2Platform
      • equalOperator

        protected ExpressionOperator equalOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • notEqualOperator

        protected ExpressionOperator notEqualOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • greaterThanOperator

        protected ExpressionOperator greaterThanOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • greaterThanEqualOperator

        protected ExpressionOperator greaterThanEqualOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • lessThanOperator

        protected ExpressionOperator lessThanOperator()
        DB2 z/OS requires that at least one argument be a known type

        For ALL, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • lessThanEqualOperator

        protected ExpressionOperator lessThanEqualOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • isNullOperator

        protected ExpressionOperator isNullOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • isNotNullOperator

        protected ExpressionOperator isNotNullOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • betweenOperator

        protected ExpressionOperator betweenOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • notBetweenOperator

        protected ExpressionOperator notBetweenOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • likeEscapeOperator

        protected ExpressionOperator likeEscapeOperator()
        DB2 z/OS support for binding the LIKE ESCAPE character depends on database configuration (mixed vs DBCS). Since we cannot know how the database in configured, we will disable parameter binding for the ESCAPE

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • notLikeEscapeOperator

        protected ExpressionOperator notLikeEscapeOperator()
        DB2 z/OS support for binding the LIKE ESCAPE character depends on database configuration (mixed vs DBCS). Since we cannot know how the database in configured, we will disable parameter binding for the ESCAPE

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • locateOperator

        protected ExpressionOperator locateOperator()
        Disable binding support.

        With all binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610

        With some binding enabled, DB2 z/OS will throw an error:

        The data type, the length, or the value of an argument of a scalar function 
         is incorrect. DB2 SQL Error: SQLCODE=-171, SQLSTATE=42815
      • locate2Operator

        protected ExpressionOperator locate2Operator()
        Disable binding support.

        With all binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610

        With some binding enabled, DB2 z/OS will throw an error:

        The data type, the length, or the value of an argument of a scalar function 
         is incorrect. DB2 SQL Error: SQLCODE=-171, SQLSTATE=42815
      • modOperator

        protected ExpressionOperator modOperator()
        Disable binding support.

        With all binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610

        With some binding enabled, DB2 z/OS will throw an error:

        The data type, the length, or the value of an argument of a scalar function 
         is incorrect. DB2 SQL Error: SQLCODE=-171, SQLSTATE=42815
      • sqrtOperator

        protected ExpressionOperator sqrtOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610
      • trimOperator

        protected ExpressionOperator trimOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610
      • trim2

        protected ExpressionOperator trim2()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The data type, the length, or the value of an argument of a scalar function 
         is incorrect. DB2 SQL Error: SQLCODE=-171, SQLSTATE=42815
        Overrides:
        trim2 in class DB2Platform
      • ltrimOperator

        protected ExpressionOperator ltrimOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610
      • ltrim2Operator

        protected ExpressionOperator ltrim2Operator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The data type, the length, or the value of an argument of a scalar function 
         is incorrect. DB2 SQL Error: SQLCODE=-171, SQLSTATE=42815
        Overrides:
        ltrim2Operator in class DB2Platform
      • rtrimOperator

        protected ExpressionOperator rtrimOperator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The statement cannot be executed because a parameter marker has been used 
         in an invalid way. DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610
      • rtrim2Operator

        protected ExpressionOperator rtrim2Operator()
        Disable binding support.

        With binding enabled, DB2 z/OS will throw an error:

        The data type, the length, or the value of an argument of a scalar function 
         is incorrect. DB2 SQL Error: SQLCODE=-171, SQLSTATE=42815
        Overrides:
        rtrim2Operator in class DB2Platform
      • inOperator

        protected ExpressionOperator inOperator()
        DB2 z/OS requires that at least one argument be a known type

        With binding enabled, DB2 z/OS will throw an error:

        The statement string specified as the object of a PREPARE contains a 
         predicate or expression where parameter markers have been used as operands of 
         the same operator for example: ? > ?. DB2 SQL Error: SQLCODE=-417, SQLSTATE=42609
      • registerOutputParameter

        public void registerOutputParameter​(java.sql.CallableStatement statement,
                                            java.lang.String name,
                                            int jdbcType)
                                     throws java.sql.SQLException
        This method is used to register output parameter on Callable Statements for Stored Procedures as each database seems to have a different method.
        Overrides:
        registerOutputParameter in class DatabasePlatform
        Throws:
        java.sql.SQLException
        See Also:
        CallableStatement.registerOutParameter(String parameterName, int sqlType)
      • registerOutputParameter

        public void registerOutputParameter​(java.sql.CallableStatement statement,
                                            java.lang.String name,
                                            int jdbcType,
                                            java.lang.String typeName)
                                     throws java.sql.SQLException
        This method is used to register output parameter on Callable Statements for Stored Procedures as each database seems to have a different method.
        Overrides:
        registerOutputParameter in class DatabasePlatform
        Throws:
        java.sql.SQLException
        See Also:
        CallableStatement.registerOutParameter(String parameterName, int sqlType, String typeName)
      • setParameterValueInDatabaseCall

        public void setParameterValueInDatabaseCall​(java.lang.Object parameter,
                                                    java.sql.CallableStatement statement,
                                                    java.lang.String name,
                                                    AbstractSession session)
                                             throws java.sql.SQLException
        Description copied from class: DatabasePlatform
        INTERNAL Set the parameter in the JDBC statement with the given name. This support a wide range of different parameter types, and is heavily optimized for common types.
        Overrides:
        setParameterValueInDatabaseCall in class DatabasePlatform
        Throws:
        java.sql.SQLException
      • setNullFromDatabaseField

        protected void setNullFromDatabaseField​(DatabaseField databaseField,
                                                java.sql.CallableStatement statement,
                                                java.lang.String name)
                                         throws java.sql.SQLException
        Overrides:
        setNullFromDatabaseField in class DatabasePlatform
        Throws:
        java.sql.SQLException
      • getParameterValueFromDatabaseCall

        public java.lang.Object getParameterValueFromDatabaseCall​(java.sql.CallableStatement statement,
                                                                  java.lang.String name,
                                                                  AbstractSession session)
                                                           throws java.sql.SQLException
        Description copied from class: DatabasePlatform
        INTERNAL Get the parameter from the JDBC statement with the given name.
        Overrides:
        getParameterValueFromDatabaseCall in class DatabasePlatform
        Throws:
        java.sql.SQLException