001/*
002// This software is subject to the terms of the Eclipse Public License v1.0
003// Agreement, available at the following URL:
004// http://www.eclipse.org/legal/epl-v10.html.
005// You must accept the terms of that agreement to use this software.
006//
007// Copyright (C) 2008-2009 Pentaho
008// All Rights Reserved.
009*/
010package mondrian.spi.impl;
011
012import java.sql.Connection;
013import java.sql.SQLException;
014
015/**
016 * Implementation of {@link mondrian.spi.Dialect} for the IBM DB2 database.
017 *
018 * @see mondrian.spi.impl.Db2OldAs400Dialect
019 *
020 * @author jhyde
021 * @since Nov 23, 2008
022 */
023public class Db2Dialect extends JdbcDialectImpl {
024
025    public static final JdbcDialectFactory FACTORY =
026        new JdbcDialectFactory(
027            Db2Dialect.class,
028            DatabaseProduct.DB2);
029
030    /**
031     * Creates a Db2Dialect.
032     *
033     * @param connection Connection
034     */
035    public Db2Dialect(Connection connection) throws SQLException {
036        super(connection);
037    }
038
039    public String toUpper(String expr) {
040        return "UCASE(" + expr + ")";
041    }
042
043    public boolean supportsGroupingSets() {
044        return true;
045    }
046
047    public boolean requiresOrderByAlias() {
048        return true;
049    }
050}
051
052// End Db2Dialect.java
053