Question

stack-trace:

Exception in thread "main" org.pivot4j.PivotException: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc4.Jdbc4Connection.unwrap(Class<T>) is not yet implemented.
    at org.pivot4j.impl.PivotModelImpl.initialize(PivotModelImpl.java:202)
    at cn.sdut.pivot4j.App.main(App.java:25)
Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc4.Jdbc4Connection.unwrap(Class<T>) is not yet implemented.
    at org.postgresql.Driver.notImplemented(Driver.java:710)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.unwrap(AbstractJdbc4Connection.java:218)
    at org.postgresql.jdbc4.Jdbc4Connection.unwrap(Jdbc4Connection.java:21)
    at org.pivot4j.datasource.SimpleOlapDataSource.createConnection(SimpleOlapDataSource.java:77)
    at org.pivot4j.datasource.AbstractOlapDataSource.getConnection(AbstractOlapDataSource.java:105)
    at org.pivot4j.datasource.AbstractOlapDataSource.getConnection(AbstractOlapDataSource.java:95)
    at org.pivot4j.impl.PivotModelImpl.createConnection(PivotModelImpl.java:242)
    at org.pivot4j.impl.PivotModelImpl.initialize(PivotModelImpl.java:200)
    ... 1 more

I'm writing a simple program using Mondrain and Pivot4j. Following is the code I've written:

public class App {
    public static void main(String[] args) throws Exception {

        SimpleOlapDataSource dataSource = new SimpleOlapDataSource();
        dataSource.setConnectionString("jdbc:postgresql://localhost:5432/food_mart?user=postgres&password=111111");

        String initialMdx = "SELECT {[Measures].[Unit Sales], [Measures].[Store Cost], "
                + "[Measures].[Store Sales]} ON COLUMNS, {([Promotion Media].[All Media], "
                + "[Product].[All Products])} ON ROWS FROM [Sales]";

        PivotModel model = new PivotModelImpl(dataSource);
        model.setMdx(initialMdx);
        model.initialize(); // throws Exception
    }
}

I have no idea about why I got this Exception.

Was it helpful?

Solution

I'm the developer of Pivot4J and I suppose your problem to be the same with what this post describes :

You need to specify Olap4J's connections string, not that of underlying RDBMS for the data source.

For reference about connection string syntax, you can refer to API documentation for appropriate Olap4J driver implementations, that is either MondrianOlap4JDriver or XmlaOlap4JDriver.

Also, please feel free to visit our mailing list, it you have further questions about Pivot4J.

Hope this helps.

Xavier

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top