Class Db2SqlDialect

  • public class Db2SqlDialect
    extends SqlDialect
    A SqlDialect implementation for the IBM DB2 database.
    • Field Detail

    • Constructor Detail

      • Db2SqlDialect

        public Db2SqlDialect​(SqlDialect.Context context)
        Creates a Db2SqlDialect.
    • Method Detail

      • supportsCharSet

        public boolean supportsCharSet()
        Description copied from class: SqlDialect
        Returns whether the dialect supports character set names as part of a data type, for instance VARCHAR(30) CHARACTER SET `ISO-8859-1`.
        supportsCharSet in class SqlDialect
      • hasImplicitTableAlias

        public boolean hasImplicitTableAlias()
        Description copied from class: SqlDialect
        Returns whether a qualified table in the FROM clause has an implicit alias which consists of just the table name.

        For example, in SqlDialect.DatabaseProduct.ORACLE

        SELECT * FROM sales.emp

        is equivalent to

        SELECT * FROM sales.emp AS emp

        and therefore

        SELECT emp.empno FROM sales.emp

        is valid. But SqlDialect.DatabaseProduct.DB2 does not have an implicit alias, so the previous query it not valid; you need to write

        SELECT sales.emp.empno FROM sales.emp

        Returns true for all databases except DB2.

        hasImplicitTableAlias in class SqlDialect
      • unparseSqlIntervalLiteral

        public void unparseSqlIntervalLiteral​(SqlWriter writer,
                                              SqlIntervalLiteral literal,
                                              int leftPrec,
                                              int rightPrec)
        Description copied from class: SqlDialect
        Converts an interval literal to a SQL string. The default implementation returns strings such as INTERVAL '1 2:3:4' DAY(4) TO SECOND(4).
        unparseSqlIntervalLiteral in class SqlDialect