1.下載:
mondrian-2.0.0.zip ,解壓至D:\Mondrian
2. 把lib\mondrian.war解壓到? {TOMCAT_HOME}\webapps\mondrain
3. Mondrian demo中數(shù)據(jù)庫FoodMart默認的是access,? 要移植到mysql中,用demo\FoodMartCreateData.sql,
在命令行窗口中輸入如下腳本:
java -cp "lib\mondrian.jar;lib\log4j-1.2.9.jar;lib\eigenbase-xom.jar;lib\eigenbase-resgen.jar;lib\eigenbase-properties.jar;lib\mysql-connector-java-3.1.7-bin.jar" mondrian.test.loader.MondrianFoodMartLoader -tables -data -indexes? -jdbcDrivers="com.mysql.jdbc.Driver" -inputFile=demo\FoodMartCreateData.sql -outputJdbcURL="jdbc:mysql://localhost/foodmart?user=root&password="
注意:當前路徑是E:\workspace\Mondrian.? 運行需要的部分類包在mondrian-2.0.0-src.zip的lib目錄中,需要加入mysql jdbc 驅(qū)動.? log4j-1.2.9.jar里面如果加入log4j.properties文件,可以查看運行時候的打印信息,否則看不到打印信息。
4. 在{TOMCAT_HOME}\webapps\mondrain目錄,?
????? 打開mondrian.properties, 添加下面屬性mondrian.jdbcDrivers=com.mysql.jdbc.Driver
?????? 打開WEB-INF\web.xml, 修改2處connectString屬性,
Jdbc=jdbc:mysql://localhost/foodmart?user=root&password=;JdbcDrivers=com.mysql.jdbc.Driver;?
?????? 編輯
WEB-INF\queries下面的 fourheir
, mondrian
, colors
and arrows 4個jsp文件.
?????
<jp:mondrianQuery id="query01" jdbcDriver="com.mysql.jdbc.Driver" jdbcUrl="jdbc:mysql://localhost/foodmart?user=root&password=" catalogUri="/WEB-INF/queries/FoodMart.xml">