Package mondrian.olap

Examples of mondrian.olap.Connection.parseQuery()


            Connection connection = getConnection();
            String cubeName = getDefaultCubeName();
            if (cubeName.indexOf(' ') >= 0) {
                cubeName = Util.quoteMdxIdentifier(cubeName);
            }
            Query query = connection.parseQuery("select from " + cubeName);
            Result result = connection.execute(query);
            Util.discard(result);
            connection.close();
            return true;
        } catch (RuntimeException e) {
View Full Code Here


            + " [Product].[All Products].Children)),\n"
            + " Crossjoin ({([Gender].[All Gender].[F],\n"
            + " [Marital Status].[All Marital Status],\n"
            + " [Customers].[All Customers].[USA])},\n"
            + " [Product].[All Products].Children))) ON rows  from [Sales]  where [Time].[1997]";
        Query query = connection.parseQuery(queryString);
        // If this call took longer than 10 seconds, the performance bug has
        // probably resurfaced again.
        final long afterParseMillis = System.currentTimeMillis();
        final long afterParseNonDbMillis =
            afterParseMillis - Util.dbTimeMillis();
View Full Code Here

            TestContext.instance().getConnection();
        String queryString =
            "select {[Measures].[Unit Sales]} on columns,\n"
            + "{[Customers].members} on rows\n"
            + "from Sales";
        Query query = connection.parseQuery(queryString);
        Result result = connection.execute(query);
        assertEquals(10407, result.getAxes()[1].getPositions().size());
    }

    public void testUnparse() {
View Full Code Here

        assertEquals(10407, result.getAxes()[1].getPositions().size());
    }

    public void testUnparse() {
        Connection connection = getConnection();
        Query query = connection.parseQuery(
            "with member [Measures].[Rendite] as \n"
            + " '(([Measures].[Store Sales] - [Measures].[Store Cost])) / [Measures].[Store Cost]',\n"
            + " format_string = iif(([Measures].[Store Sales] - [Measures].[Store Cost]) / [Measures].[Store Cost] * 100 > \n"
            + "     Parameter (\"UpperLimit\", NUMERIC, 151, \"Obere Grenze\"), \n"
            + "   \"|#.00%|arrow='up'\",\n"
View Full Code Here

            s);
    }

    public void testUnparse2() {
        Connection connection = getConnection();
        Query query = connection.parseQuery(
            "with member [Measures].[Foo] as '1', "
            + "format_string='##0.00', "
            + "funny=IIf(1=1,\"x\"\"y\",\"foo\") "
            + "select {[Measures].[Foo]} on columns from Sales");
        final String s = query.toString();
View Full Code Here

            + SleepUdf.class.getName()
            + "\"/>",
            null);
        Connection connection = tc.getConnection();

        final Query query = connection.parseQuery(queryString);
        final Throwable[] throwables = {null};
        if (waitMillis == 0) {
            // cancel immediately
            try {
                query.getStatement().cancel();
View Full Code Here

        propSaver.set(props.IterationLimit, 11);

        Throwable throwable = null;
        try {
            Connection connection = getConnection();
            Query query = connection.parseQuery(queryString);
            query.setResultStyle(ResultStyle.LIST);
            connection.execute(query);
        } catch (Throwable ex) {
            throwable = ex;
        }
View Full Code Here

        // We are testing the old Query API.
        final Connection connection =
            context.getConnection();
        final Query q1 =
            connection.parseQuery(mdx);
        final Query q2 =
            connection.parseQuery(mdx);

        // Some flags to test.
        final AtomicBoolean fail =
View Full Code Here

        final Connection connection =
            context.getConnection();
        final Query q1 =
            connection.parseQuery(mdx);
        final Query q2 =
            connection.parseQuery(mdx);

        // Some flags to test.
        final AtomicBoolean fail =
            new AtomicBoolean(false);
        final AtomicBoolean success =
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.