我不知道如何生成或创建带有Olap4j/Olap连接的Cube,当我有Cube时,我可以加载它并使用它工作,但是我有数据库,我想从代码generate中获得它,并将它保存为xml。那么我们有多少种方法可以做到这一点?
Connection connection = DriverManager.getConnection(
String.format(
"jdbc:mondrian:Jdbc=%s; Catalog=file:%s",
"jdbc:mysql://localhost:3306/network?user=root&password=root",
"C:\\Users\\John\\Documents\\pivot4j-web\\src\\java\\org\\pivot4j\\analytics\\test\\FoodMartX.xml"
)
);
OlapConnection olapConnection = connection.unwrap(OlapConnection.class);
Schema s = olapConnection.getOlapSchema();
System.out.println("Schema: " + s.getName());
for (Cube cube : s.getCubes()) {
System.out.println("Cube: " + cube.getName());
for (Dimension dimension : cube.getDimensions()) {
System.out.println("Dimension: " + dimension.getName());
}
for (Measure measure : cube.getMeasures()) {
System.out.println("Measure: " + measure.getName());
}
}发布于 2014-08-09 04:00:18
Pivot4J或Olap4J用于浏览现有的OLAP模式,因此您需要使用另一个工具来创建多维数据集,这些多维数据集通常由您使用的OLAP后端的供应商提供。
至于Mondrian,有一个名为Schema的GUI应用程序,它允许您操作Mondrian模式文件。
希望这能有所帮助!
泽维尔
https://stackoverflow.com/questions/25197763
复制相似问题