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 old versions of the IBM
017 * DB2/AS400 database. Modern versions of DB2/AS400 use
018 * {@link mondrian.spi.impl.Db2Dialect}.
019 *
020 * @see mondrian.spi.impl.Db2Dialect
021 *
022 * @author jhyde
023 * @since Nov 23, 2008
024 */
025public class Db2OldAs400Dialect extends Db2Dialect {
026
027    public static final JdbcDialectFactory FACTORY =
028        new JdbcDialectFactory(
029            Db2OldAs400Dialect.class,
030            DatabaseProduct.DB2_OLD_AS400);
031
032    /**
033     * Creates a Db2OldAs400Dialect.
034     *
035     * @param connection Connection
036     */
037    public Db2OldAs400Dialect(Connection connection) throws SQLException {
038        super(connection);
039    }
040
041    public boolean allowsFromQuery() {
042        // Older versions of AS400 do not allow FROM
043        // subqueries in the FROM clause.
044        return false;
045    }
046}
047
048// End Db2OldAs400Dialect.java