0
堆棧跟蹤:方法org.postgresql.jdbc4.Jdbc4Connection.unwrap尚未實現
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
我正在寫使用Mondrain酒店和Pivot4j一個簡單的程序。以下是我寫的代碼:
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
}
}
我不知道爲什麼我得到這個異常。