// Path: src/main/java/org/olap/server/processor/Query.java
// public class Query {
// 
// 	private ServerOlapStatement serverOlapStatement;
// 	private ServerConnection serverConnection;
// 	private SelectNode selectNode;
// 	private ServerSchema schema;
// 	private ServerCatalog catalog;
// 	private Cube cube;
// 
// 	
// 	public Query(ServerOlapStatement serverOlapStatement, SelectNode node) throws OlapException {
// 		
// 		this.serverOlapStatement = serverOlapStatement;
// 		
// 		this.serverConnection = serverOlapStatement.getServerConnection();
// 		this.schema = (ServerSchema) serverConnection.getOlapSchema();
// 		this.catalog = (ServerCatalog) serverConnection.getOlapCatalog();
// 		
// 		this.selectNode = ParseUtils.normalize(serverOlapStatement.getMdxParser(), node);
// 	
// 		String cubeName = ParseUtils.identifierNames((IdentifierNode)this.selectNode.getFrom())[0];
// 		this.cube = schema.getCubes().get(cubeName);
// 		
// 		if(this.cube==null)
// 			throw new OlapException("Cube "+cubeName+" not found in schema "+schema.getName());
// 		
// 
// 	}
// 
// 	public CellSet execute() throws OlapException {
// 		
// 		ServerCellSet cellSet = new ServerCellSet(serverOlapStatement, cube); 
// 				
// 		fetchAxisMetaData(cellSet);
// 		
// 		SqlQuery query = new SqlQuery(catalog.getPhysicalSchema(), cellSet);
// 		
// 		query.generateQuery();
// 
// 		SqlConnector exec = SqlConnector.getConnector(catalog);
// 		
// 		exec.execute(query.toString(), query);
// 		
// 		
// 		return cellSet;
// 	}
// 
// 
// 
// 	protected void fetchAxisMetaData(ServerCellSet cellSet) throws OlapException {
// 		
// 		for(AxisNode axisNode : selectNode.getAxisList()){
// 			cellSet.setAxis( new ResultAxis(cellSet, axisNode ) );
// 		}
// 
// 		cellSet.setAxis( new ResultAxis(cellSet, selectNode.getFilterAxis()) );
// 
// 	}
// 
// 
// }


import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
import org.olap.server.processor.Query;
import org.olap4j.CellSet;
import org.olap4j.CellSetListener;
import org.olap4j.CellSetListener.Granularity;
import org.olap4j.OlapConnection;
import org.olap4j.OlapException;
import org.olap4j.OlapStatement;
import org.olap4j.mdx.SelectNode;
import org.olap4j.mdx.parser.MdxParser;
	}

	@Override
	public boolean isCloseOnCompletion() throws SQLException {
		return closeOnCompletion;
	}

	@Override
	public <T> T unwrap(Class<T> iface) throws SQLException {
		return null;
	}

	@Override
	public boolean isWrapperFor(Class<?> iface) throws SQLException {
		return false;
	}

	@Override
	public OlapConnection getConnection() throws SQLException {
		return serverConnection;
	}

	@Override
	public CellSet executeOlapQuery(String mdx) throws OlapException {
		SelectNode node = mdxParser.parseSelect(mdx);
		return executeOlapQuery(node);
	}

	@Override
	public CellSet executeOlapQuery(SelectNode selectNode) throws OlapException {
// Path: src/main/java/org/olap/server/processor/Query.java
// public class Query {
// 
// 	private ServerOlapStatement serverOlapStatement;
// 	private ServerConnection serverConnection;
// 	private SelectNode selectNode;
// 	private ServerSchema schema;
// 	private ServerCatalog catalog;
// 	private Cube cube;
// 
// 	
// 	public Query(ServerOlapStatement serverOlapStatement, SelectNode node) throws OlapException {
// 		
// 		this.serverOlapStatement = serverOlapStatement;
// 		
// 		this.serverConnection = serverOlapStatement.getServerConnection();
// 		this.schema = (ServerSchema) serverConnection.getOlapSchema();
// 		this.catalog = (ServerCatalog) serverConnection.getOlapCatalog();
// 		
// 		this.selectNode = ParseUtils.normalize(serverOlapStatement.getMdxParser(), node);
// 	
// 		String cubeName = ParseUtils.identifierNames((IdentifierNode)this.selectNode.getFrom())[0];
// 		this.cube = schema.getCubes().get(cubeName);
// 		
// 		if(this.cube==null)
// 			throw new OlapException("Cube "+cubeName+" not found in schema "+schema.getName());
// 		
// 
// 	}
// 
// 	public CellSet execute() throws OlapException {
// 		
// 		ServerCellSet cellSet = new ServerCellSet(serverOlapStatement, cube); 
// 				
// 		fetchAxisMetaData(cellSet);
// 		
// 		SqlQuery query = new SqlQuery(catalog.getPhysicalSchema(), cellSet);
// 		
// 		query.generateQuery();
// 
// 		SqlConnector exec = SqlConnector.getConnector(catalog);
// 		
// 		exec.execute(query.toString(), query);
// 		
// 		
// 		return cellSet;
// 	}
// 
// 
// 
// 	protected void fetchAxisMetaData(ServerCellSet cellSet) throws OlapException {
// 		
// 		for(AxisNode axisNode : selectNode.getAxisList()){
// 			cellSet.setAxis( new ResultAxis(cellSet, axisNode ) );
// 		}
// 
// 		cellSet.setAxis( new ResultAxis(cellSet, selectNode.getFilterAxis()) );
// 
// 	}
// 
// 
// }


// Path: src/main/java/org/olap/server/driver/ServerOlapStatement.java
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
import org.olap.server.processor.Query;
import org.olap4j.CellSet;
import org.olap4j.CellSetListener;
import org.olap4j.CellSetListener.Granularity;
import org.olap4j.OlapConnection;
import org.olap4j.OlapException;
import org.olap4j.OlapStatement;
import org.olap4j.mdx.SelectNode;
import org.olap4j.mdx.parser.MdxParser;

	}

	@Override
	public boolean isCloseOnCompletion() throws SQLException {
		return closeOnCompletion;
	}

	@Override
	public <T> T unwrap(Class<T> iface) throws SQLException {
		return null;
	}

	@Override
	public boolean isWrapperFor(Class<?> iface) throws SQLException {
		return false;
	}

	@Override
	public OlapConnection getConnection() throws SQLException {
		return serverConnection;
	}

	@Override
	public CellSet executeOlapQuery(String mdx) throws OlapException {
		SelectNode node = mdxParser.parseSelect(mdx);
		return executeOlapQuery(node);
	}

	@Override
	public CellSet executeOlapQuery(SelectNode selectNode) throws OlapException {
		Query query = new Query(this, selectNode);