当前位置: 首页>>代码示例>>Java>>正文


Java SelectNode类代码示例

本文整理汇总了Java中org.olap4j.mdx.SelectNode的典型用法代码示例。如果您正苦于以下问题:Java SelectNode类的具体用法?Java SelectNode怎么用?Java SelectNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SelectNode类属于org.olap4j.mdx包,在下文中一共展示了SelectNode类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testBugMondrian1204

import org.olap4j.mdx.SelectNode; //导入依赖的package包/类
/**
 * Test case for
 * <a href="http://jira.pentaho.com/browse/MONDRIAN-1204">MONDRIAN-1204,
 * "Olap4j's method toOlap4j throws NPE if we have a function"</a>.
 */
public void testBugMondrian1204() throws SQLException {
    final OlapConnection connection =
        TestContext.instance().getOlap4jConnection();
    final String mdx =
        "SELECT\n"
        + "NON EMPTY {Hierarchize({[Measures].[Customer Count]})} ON COLUMNS,\n"
        + "CurrentDateMember([Time], \"\"\"[Time].[Year].[1997]\"\"\") ON ROWS\n"
        + "FROM [Sales 2]";
    try {
        final MdxParserFactory parserFactory =
            connection.getParserFactory();
        MdxParser mdxParser =
            parserFactory.createMdxParser(connection);
        MdxValidator mdxValidator =
            parserFactory.createMdxValidator(connection);

        SelectNode select = mdxParser.parseSelect(mdx);
        SelectNode validatedSelect = mdxValidator.validateSelect(select);
        Util.discard(validatedSelect);
    } finally {
        Util.close(null, null, connection);
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:29,代码来源:Olap4jTest.java


示例2: Query

import org.olap4j.mdx.SelectNode; //导入依赖的package包/类
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());
	

}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:19,代码来源:Query.java


示例3: executeOlapQuery

import org.olap4j.mdx.SelectNode; //导入依赖的package包/类
@Override
public CellSet executeOlapQuery(String mdx) throws OlapException {
	SelectNode node = mdxParser.parseSelect(mdx);
	return executeOlapQuery(node);
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:6,代码来源:ServerOlapStatement.java


示例4: executeOlapQuery

import org.olap4j.mdx.SelectNode; //导入依赖的package包/类
@Override
public CellSet executeOlapQuery(SelectNode selectNode) throws OlapException {
	return statement.executeOlapQuery(selectNode);
}
 
开发者ID:Wondersoft,项目名称:olaper,代码行数:5,代码来源:ServerPreparedOlapStatement.java


示例5: execute

import org.olap4j.mdx.SelectNode; //导入依赖的package包/类
public ResultSetHandle execute(
   		@Nullable SPVariableHelper variablesContext,
   		@Nullable ResultSetListener listener,
   		boolean async) throws ResultSetProducerException
{
       try {
       	
       	String textualQuery;
       	if (this.modifiedOlapQuery == null) {
       		// take the snapshot
       		SelectNode mdx;
       		synchronized (this) {
       			if (getRowHierarchies().isEmpty() || getColumnHierarchies().isEmpty()) {
       				return null;
       			} else {
       				mdx = getMDXQuery().getSelect();
       			}
       		}
       		
       		textualQuery = mdx.toString();
       	
       	} else {
       	
       		textualQuery = this.getModifiedOlapQuery();
       		
       	}
       	
       	return 
       		rsps.execute(
       				this.getSession().getContext(),
       				getOlapDataSource(),
       				textualQuery,
       				variablesContext,
       				ResultSetType.OLAP, 
        			0, 
        			listener,
        			async);	
           
       } catch (Exception e) {
           throw new ResultSetProducerException("Couldn't create database connection for Olap query", e);
       } finally {
       	if (this.variableProvider!=null) {
       		this.variableProvider.setUpdateNeeded(true);
           }
       }
   }
 
开发者ID:SQLPower,项目名称:wabit,代码行数:47,代码来源:OlapQuery.java



注:本文中的org.olap4j.mdx.SelectNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。