The magic of fingertips

工具:

操作步骤:

1)、在saiku-datasources目录下创建file并命名为testdatasource,文件内容为如下

type=OLAPname=testdatasourcedriver=mondrian.olap4j.MondrianOlap4jDriverlocation=jdbc:mondrian:Jdbc=jdbc:mysql://localhost:3306/testdatasource;Catalog=res:testdatasource/testdatasource.xml;username=rootpassword=111111

2)、解释下上面一条的的参数

type=OLAP就不多说了,先按固定的来

name=testdatasource 数据源名称

driver=mondrian.olap4j.MondrianOlap4jDriver 可以理解为固定的,Mondrian的多维查询driver

location一行比较长,,其中有一段jdbc:mysql://localhost:3306/testdatasource为数据库的url,

后面的res:testdatasource/testdatasource.xml是vfs的一种url写法,表示是classes目录下的testdatasource/testdatasource.xml文件username和password就不多说了,如果看不懂,就去翻译一下吧

3)、创建表和插入数据,执行语句如下A、创建表t_userDROP TABLE IF EXISTS `t_user`;CREATE TABLE `t_user` ( `user_id` int(11) NOT NULL, `user_name` varchar(255) DEFAULT NULL, `pwd` varchar(255) DEFAULT NULL, PRIMARY KEY (`user_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;– —————————— Records of t_user– —————————-INSERT INTO `t_user` VALUES (‘1’, ‘user1’, ‘1’);INSERT INTO `t_user` VALUES (‘2’, ‘user2’, ‘2’);INSERT INTO `t_user` VALUES (‘3’, ‘user3’, ‘3’);INSERT INTO `t_user` VALUES (‘4’, ‘user4’, ‘4’);B、创建表t_dataDROP TABLE IF EXISTS `t_data`;CREATE TABLE `t_data` ( `user_id` int(11) DEFAULT NULL, `count` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;– —————————— Records of t_data– —————————-INSERT INTO `t_data` VALUES (‘1′, ’23’);INSERT INTO `t_data` VALUES (‘2′, ’22’);INSERT INTO `t_data` VALUES (‘3′, ’21’);INSERT INTO `t_data` VALUES (‘4′, ’25’);INSERT INTO `t_data` VALUES (‘2′, ’21’);INSERT INTO `t_data` VALUES (‘4′, ’22’);4)、在resource文件夹下建文件夹testdatasource,并在其下创建文件testdatasource.xml,文件内容如下<?xml version="1.0" encoding="UTF-8" ?><Schema name="test_schema"><cube name="test_cube"> <Table name="t_data"></Table> <Dimension name="user" foreignKey="user_id"> <Hierarchy hasAll="true" allMemberName="user_id" primaryKey="user_id" > <Table name="t_user" /> <Level name="user_id" column="user_id" uniqueMembers="true" type="Integer" /> </Hierarchy> </Dimension> <Measure column="count" aggregator="sum" datatype="Numeric" name="all_count" caption="all_count"></Measure></cube></Schema>

这个配置在这里就不做太多解释了

经过以上几个不步骤,就可以完美的运行saiku的server服务了

转载请手下留情,注明出处,也不枉我辛苦一场,谢谢

人生就是一次充满未知的旅行,在乎的是沿途的风景,

The magic of fingertips

相关文章:

你感兴趣的文章:

标签云: