mondrian.spi.impl
Class Db2Dialect

java.lang.Object
  extended by mondrian.spi.impl.JdbcDialectImpl
      extended by mondrian.spi.impl.Db2Dialect
All Implemented Interfaces:
Dialect
Direct Known Subclasses:
Db2OldAs400Dialect

public class Db2Dialect
extends JdbcDialectImpl

Implementation of Dialect for the IBM DB2 database.

Since:
Nov 23, 2008
Version:
$Id: //open/mondrian/src/main/mondrian/spi/impl/Db2Dialect.java#3 $
Author:
jhyde
See Also:
Db2OldAs400Dialect

Nested Class Summary
 
Nested classes/interfaces inherited from interface mondrian.spi.Dialect
Dialect.DatabaseProduct, Dialect.Datatype, Dialect.NullCollation
 
Field Summary
static JdbcDialectFactory FACTORY
           
 
Fields inherited from class mondrian.spi.impl.JdbcDialectImpl
databaseProduct, permitsSelectNotInGroupBy, productVersion
 
Constructor Summary
Db2Dialect(Connection connection)
          Creates a Db2Dialect.
 
Method Summary
 boolean requiresOrderByAlias()
          Returns true if this Dialect can include expressions in the ORDER BY clause only by adding an expression to the SELECT clause and using its alias.
 boolean supportsGroupingSets()
          Returns whether this Dialect allows the GROUPING SETS construct in the GROUP BY clause.
 String toUpper(String expr)
          Converts an expression to upper case.
 
Methods inherited from class mondrian.spi.impl.JdbcDialectImpl
allowsAs, allowsCompoundCountDistinct, allowsCountDistinct, allowsDdl, allowsDialectSharing, allowsFromQuery, allowsMultipleCountDistinct, allowsMultipleDistinctSqlMeasures, allowsOrderByAlias, allowsSelectNotInGroupBy, appendHintsAfterFromClause, caseWhenElse, deduceIdentifierQuoteString, deduceMaxColumnNameLength, deduceProductName, deduceProductVersion, deduceReadOnly, deduceSupportedResultSetStyles, deduceSupportsSelectNotInGroupBy, generateInline, generateInlineForAnsi, generateInlineGeneric, generateOrderItem, getDatabaseProduct, getMaxColumnNameLength, getNullCollation, getProduct, getQuoteIdentifierString, needsExponent, quote, quoteBooleanLiteral, quoteDateLiteral, quoteDateLiteral, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteNumericLiteral, quoteStringLiteral, quoteTimeLiteral, quoteTimestampLiteral, requiresAliasForFromQuery, requiresGroupByAlias, requiresUnionOrderByExprToBeInSelectClause, requiresUnionOrderByOrdinal, supportsGroupByExpressions, supportsMultiValueInExpr, supportsOrderByNullsLast, supportsResultSetConcurrency, supportsUnlimitedValueList, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FACTORY

public static final JdbcDialectFactory FACTORY
Constructor Detail

Db2Dialect

public Db2Dialect(Connection connection)
           throws SQLException
Creates a Db2Dialect.

Parameters:
connection - Connection
Throws:
SQLException
Method Detail

toUpper

public String toUpper(String expr)
Description copied from interface: Dialect
Converts an expression to upper case.

For example, for MySQL, toUpper("foo.bar") returns "UPPER(foo.bar)".

Specified by:
toUpper in interface Dialect
Overrides:
toUpper in class JdbcDialectImpl
Parameters:
expr - SQL expression
Returns:
SQL syntax that converts expr into upper case.

supportsGroupingSets

public boolean supportsGroupingSets()
Description copied from interface: Dialect
Returns whether this Dialect allows the GROUPING SETS construct in the GROUP BY clause. Currently Oracle, DB2 and Teradata.

Specified by:
supportsGroupingSets in interface Dialect
Overrides:
supportsGroupingSets in class JdbcDialectImpl
Returns:
Whether this Dialect allows GROUPING SETS clause

requiresOrderByAlias

public boolean requiresOrderByAlias()
Description copied from interface: Dialect
Returns true if this Dialect can include expressions in the ORDER BY clause only by adding an expression to the SELECT clause and using its alias.

For example, in such a dialect,

SELECT x FROM t ORDER BY x + y
would be illegal, but
SELECT x, x + y AS z FROM t ORDER BY z
would be legal.

MySQL, DB2 and Ingres are examples of such dialects.

Specified by:
requiresOrderByAlias in interface Dialect
Overrides:
requiresOrderByAlias in class JdbcDialectImpl
Returns:
Whether this Dialect can include expressions in the ORDER BY clause only by adding an expression to the SELECT clause and using its alias

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads