001 /* 002 // $Id: OlapStatement.java 229 2009-05-08 19:11:29Z jhyde $ 003 // This software is subject to the terms of the Eclipse Public License v1.0 004 // Agreement, available at the following URL: 005 // http://www.eclipse.org/legal/epl-v10.html. 006 // Copyright (C) 2006-2008 Julian Hyde 007 // All Rights Reserved. 008 // You must accept the terms of that agreement to use this software. 009 */ 010 package org.olap4j; 011 012 import java.sql.Statement; 013 014 import org.olap4j.mdx.SelectNode; 015 016 /** 017 * Object used for statically executing an MDX statement and returning a 018 * {@link CellSet}. 019 * 020 * <p>An <code>OlapStatement</code> is generally created using 021 * {@link OlapConnection#createStatement()}.</p> 022 * 023 * @see PreparedOlapStatement 024 * 025 * @author jhyde 026 * @version $Id: OlapStatement.java 229 2009-05-08 19:11:29Z jhyde $ 027 * @since Aug 22, 2006 028 */ 029 public interface OlapStatement extends Statement, OlapWrapper { 030 031 /** 032 * Executes an OLAP statement. 033 * 034 * @param mdx MDX <code>SELECT</code> statement 035 * 036 * @return Cell set 037 * 038 * @throws OlapException if a database access error occurs, 039 * this method is called on a closed <code>OlapStatement</code>, 040 * the query times out (see {@link #setQueryTimeout(int)}) 041 * or another thread cancels the statement (see {@link #cancel()}) 042 */ 043 CellSet executeOlapQuery(String mdx) throws OlapException; 044 045 /** 046 * Executes an OLAP statement expressed as a parse tree. 047 * 048 * <p>Validates the parse tree before executing it. 049 * 050 * @param selectNode Parse tree of MDX <code>SELECT</code> statement 051 * 052 * @return Cell set 053 * 054 * @throws OlapException if a database access error occurs, 055 * this method is called on a closed <code>OlapStatement</code>, 056 * the query times out (see {@link #setQueryTimeout(int)}) 057 * or another thread cancels the statement (see {@link #cancel()}) 058 */ 059 CellSet executeOlapQuery(SelectNode selectNode) throws OlapException; 060 } 061 062 // End OlapStatement.java