How to use a PostgreSQL DB as XMLA datasource? - postgresql

Basis:
PostgreSQL database with normal and reporting data
Downloaded the Mondrian zip from here
I have a client pivot grid component (DevExtreme Web)
As i understand it so far, i have to use a OLAP-server that functions as connector between MDX querys and a SQL database to provide XMLA as datasource. Therefor i want to use the Mondrian OLAP-server.
Question:
Now i need to start the Mondrian OLAP-server, connect it to the PostgreSQL database and provide a OLAP-schema.
How to start the Mondrian OLAP-server?
How to connect it to a PostgreSQL database?
How to provide a schema to the mondrian server?
And finaly, how to connect to the mondrian server?
I can't find any step by step guide or any usefull documentation of mondrian. It's all a big cloud to me.

The Problem
After many, many hours i found this thread: Github - Mondrian issue 202
The Mondrian developer, in this thread, clearly state that nearly the whole documentation is outdated and doesn't have much todo with the actual Mondrian 4 OLAP server.
They say that Mondrian 4 is no longer shiped with a deployable WAR file and the schema has big changes.
Start Mondrian OLAP Server
To get Mondrian running i downloaded this maven project that starts a mondrian server: mondrian-xmla-spike
I got everything running with the discribed derby Foodmart database.
You can either import the project as maven project in an IDE of your choice (what i did) or run mvn via. console.
Use Mondrian as XMLA provider
In the maven project you have to check all files (not many) for hardcoded paths and change them to your environment.
If you have done this, and startet the project as application, the Mondrian Server should be accessible via. a jetty server on the address http://localhost:8888/xmla
You can connect any component that can use a XMLA datasource and does support Mondrian OLAP server! The last part is very important. Mondrian doesn't comply with the MDX standard completely. Bad decision on the side of Penthao! Most OLAP-components or BI-tools only support MS SQL Server as XMLA datasource.
Connect Mondrian to PostgreSQL DB
To connect the existing maven project to a PostgreSQL DB i had to do some steps:
Update the Mondrian Version in the pom (xmla-spike.xml) file to a 4.x Version (i used 4.3.1.5-191). You can choose one from here: Penthao Mondrian Versions
Download the correct JDBC driver (for me it was JDBC42): PostgreSQL JDBC Driver and add the JDBC driver (.jar) to your project libraries
Or add the correct JDBC driver (i used 9.4.1209) from here: PostgreSQL JDBC Driver JDBC 4.1 to your maven pom (xmla-spike.xml).
Change the <DataSourceInfo> in the datasource.xml to:
Provider=mondrian;Jdbc=jdbc:postgresql://localhost:5432/default?user=postgre;JdbcDrivers=org.postgresql.Driver;Catalog=/WEB-INF/Schema.xml;
DB url: jdbc:postgresql://localhost:5432/default?user=postgre
=> jdbc:postgresql://host:port/database
Create the Schema.xml file and write a simple schema as descriped here: How to Design a Mondrian 4 Schema
You can look at the Foodmart example Schema with metamodel 4 here: Foodmart.xml metamodelVersion="4.0"
The <Catalog name="*"> must mach the schema name of the Schema.xml
This does work for me. I hope i can help someone else with this. If i forgot some steps, pls comment and i will add the missing steps.

Related

Connect MobileFirst Application with DB2

I am using Mobilefirst 8.0. I wanted to connect my hybrid application to DB2 database and create table in that and retrieve data from this. I just came to know after reading some documents that have to use sql adapter. but
1) how to configure and add external dependancies of JDBC driver?
2) Can I do this from my local developer server?
Please any one can guide me.
You have several questions there...
I wanted to connect my hybrid application to DB2 database and create table in that
To create a DB2 database and table in it, you need to install DB2 and create a table in it. This is not related to IBM MobileFirst. Consult the DB2 documentation.
... and retrieve data from this. I just came to know after reading some documents that have to use sql adapter.
In IBM MobileFirst Foundation 8.0 you can create either a Java adapter or a JavaScript adapter, depending on your proficiency and your project requirements.
In a Java adapter it is expected that you will create and handle the database connection as is standard in Java programming.
Read more about creating Java adapters: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/java-adapters/
Read more about SQL in Java adapters: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/java-adapters/java-sql-adapter/
In JavaScript adapters, MobileFirst Server takes care of many aspects, but you still need to do some minimal configurations, such as providing the database URL, and the username and password for it.
Read more about JavaScript adapters: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/javascript-adapters/
Read more about SQL JavaScript adapters: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/javascript-adapters/js-sql-adapter/
About retrieving data and display it, etc, there are plenty of existing questions about this in Stack Overflow. Simply search for some implementation pointers.
How to configure and add external dependancies of JDBC driver
In MobileFirst Foundation 8.0 adapters are actually Maven projects. As such dependencies such as database connectors are handled via the Maven dependencies mechanism.
Learn more about adapters in general: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/
Learn how to creating adapters and adding dependencies: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/creating-adapters/
Since you're using DB2, you need to search the Maven repository for a DB2 connector and add it to your adapter's pom.xml file, then build the adapter to verify that it manages to pull the connector and that there are no compilation errors.
The example SQL adapter provided in the links above defined a connector for a MySQL database in its pom.xml. You can base your adapter on the changes made in that sample adapter.
For example:
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc</artifactId>
<version>3.8.47</version>
</dependency>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>3.8.47</version>
</dependency>
Can I do this from my local developer server?
This is not related to the server. It is all done in the adapter.

Installing Pentaho Mondrian and integrating it with custom web application

Installing Pentaho Mondrian and using it with custom web application.
I apologize in advance, if my questions seem to be too global, but there's not much info about these topics on internet and I need at least some common answers about overall direction that I should have.
Here's the deal, I have:
Some web app (Django/.NET/Nodejs, doesn't matter really)
Postgres database
Now I need some OLAP server, that I can run my MDX queries against and get analytics. In this case, Pentaho Mondrian OLAP server was chosen.
So I guess, these steps are needed to be done:
Install and run Mondrian as a server
Connect Mondrian to Postgres
Create XML cube schema file via Schema Workbench(seems to be obsolete) or manually
Call Mondrian via some API from my web app
Am I missing something?
Questions:
How do I install and run Mondrian as a server? Unfortunately, I've only found some confusing and obsolete info about it, even in official documentation.
How do I pass MDX queries from my web app to Mondrian and get results back in some meaningful way or form? Is there any API on Mondrian side?
Thank you.

Integrating eclipse with db2

I was doing a project related to the IBM competition and need to create a web application. I have done a web application before by connecting netbeans and mysql. But, now am facing problem right from installation.
Is there any workbench(like something for mysql) for db2 . If so can anyone give a link. Also, I need to make jdbc connections. So, is there any other software I need to install.
Kindly explain to me in detail as I'm not pretty sure about this.
All you need is a DB2 JDBC JAR. Pick the appropriate one for your version and add it to your CLASSPATH.
You should use either a DB2 admin client to create tables and view data or something like SQL Squirrel.

Unable to browse in Eclipse tables for any schema in Informix

EDIT: Although this question is still unanswered for 3.X versions of Eclipse, using 4.X versions (Juno) solves the problem.
I can't browse tables for a given schema in Informix using Eclipse Data Source Explorer. The only tables I can browse is the catalog, the sys* ones in the Informix schema.
I'm using Eclipse v3.6 (Helios) with Data Tools Project plugin v1.9.2 for accessing an Informix 11.70 database.
The driver (v10.0) and the connection configuration seem to be right as I can ping and query properly using the SQL scrap book, creating and selecting tables. In fact the applications work perfectly once deployed, but I'm unable to use Eclipse features such as JPS tools.
The user has the proper access and is able to browse and operate anything from Server Studio.
I've searched Google for a few days and found some cases expriencing something alike (for instance it can happen in MySQL if you're missing the database in the URL), but found no proper answer.
Thanks in advance
P.S.: I have the same question open in DTP forum http://www.eclipse.org/forums/index.php/m/874976/#msg_874976
P.S. II: I've created a test project that illustrates the problem. Notice the "Tables" node can't be expanded.
The issue will be 'How does Eclipse Helios with Data Tools Project' go looking for tables in an Informix database?
If it interrogates the Informix system catalog directly (systables, syscolumns, ...), there should not be an issue. The fact that you can browse the system catalog tables is curious. Maybe it is only showing you tables 'owned by informix' in the Informix jargon; that would be 'in the schema informix' in some other systems' jargon. Look at the plugin options to see if you can change the schema name somehow, or have it look at all schemas simultaneously.
If it is looking for standard SQL 'Information Schema' tables, those are AWOL in Informix. You might be able to run dbaccess yourdb $INFORMIXDIR/etc/xpg4_is.sql and get enough of an archaic version of the Information Schema tables (from the XPG4 – X/Open Portability Guide version 4 – definition of the Information Schema) to be usable, but I'd not want to bet on it being adequate.

Birt Eclipse, connecting to a SQLite database through ODBC? Do I need a specific JDBC driver for Birt to use?

I have been working on this for a while now and, unfortunately have little previous exposure to Birt as well as JDBC / ODBC. I've been searching and searching but can't conclusively figure out what I need for Birt to be able to connect to an SQLite database through ODBC.
I have setup the SQLit db on my windows machine to use ODBC. From here, however, I can't figure out, in the Birt Report Designer-> New data source-> JDBC data source what I am supposed to put in in order to access the DB.
Do I need a specific driver for this that I need to install to use as the "Driver Class"
Is the path to my ODBC / SQLite db the "Driver URL" field?
I would greatly appreciate any advice on this.
There is a JDBC driver specifically for SQLite, so you don't have to use a bridge.
The URL should be:
jdbc:sqlite:/path/to/my.db
The class is org.sqlite.JDBC.
As the initial answer points out, you can download the SQLite JDBC driver. Once downloaded, you need to correctly deploy the JAR into BIRT so the driver will be available in the eclipse designer. Put the JAR in:
<BIRT Install>\eclipse\plugins\com.actuate.data.oda.jdbc.drivers_<BIRT VERSION>
Once the JAR is there, re-start Eclipse/BIRT and you should be able to create a SQLite data source pretty easily.
Good Luck!