eMondrian reads data from any database with a JDBC driver. The image includes drivers for:

DatabaseDriver classIncluded
ClickHousecom.clickhouse.jdbc.ClickHouseDriver✓ (0.8.2)
PostgreSQLorg.postgresql.Driver✓ (42.2.20)
HSQLDBorg.hsqldb.jdbc.JDBCDriver✓ (used by FoodMart)
MySQL, SQL Server, Oracle, otherssee the vendor’s documentationadd the driver — see below

A connection is declared as a catalog in datasources.xml. The general shape:

<Catalog name="MyData">
  <DataSourceInfo>Provider=mondrian;Jdbc=<JDBC URL>;JdbcUser=<user>;JdbcPassword=<password>;JdbcDrivers=<driver class></DataSourceInfo>
  <Definition>/WEB-INF/schema/MyData.xml</Definition>
</Catalog>

Details and rules (element order, escaping): datasources.xml reference. After changing datasources.xml, restart: docker compose restart eMondrian.

ClickHouse

<Catalog name="MyClickHouse">
  <DataSourceInfo>Provider=mondrian;Jdbc=jdbc:clickhouse://my-host:8123/mydb?user=myuser&amp;password=mypassword;JdbcDrivers=com.clickhouse.jdbc.ClickHouseDriver</DataSourceInfo>
  <Definition>/WEB-INF/schema/MyClickHouse.xml</Definition>
</Catalog>
  • Port 8123 is ClickHouse’s HTTP interface. For HTTPS (e.g. ClickHouse Cloud) use port 8443 and add &amp;ssl=true.
  • The sample OnTime catalog adds settings for large queries, which you can reuse: max_query_size=100000000&amp;max_ast_elements=100000000&amp;max_expanded_ast_elements=100000000&amp;socket_timeout=300000
  • In schemas, write ClickHouse SQL with dialect="clickhouse". See Modeling on ClickHouse.

PostgreSQL

<Catalog name="MyPostgres">
  <DataSourceInfo>Provider=mondrian;Jdbc=jdbc:postgresql://my-host:5432/mydb;JdbcUser=myuser;JdbcPassword=mypassword;JdbcDrivers=org.postgresql.Driver</DataSourceInfo>
  <Definition>/WEB-INF/schema/MyPostgres.xml</Definition>
</Catalog>

In schemas, use dialect="postgres" (not postgresql) for PostgreSQL-specific SQL.

Other databases: add a JDBC driver

  1. Download the driver JAR into a drivers/ folder in the project, e.g. drivers/mysql-connector-j-9.1.0.jar.
  2. Mount it into the server’s library folder — in docker-compose.yml, under the eMondrian service volumes: (there is a commented-out example for ClickHouse):
    - ./drivers/mysql-connector-j-9.1.0.jar:/usr/local/tomcat/webapps/emondrian/WEB-INF/lib/mysql-connector-j-9.1.0.jar
  3. Use the driver class in the catalog, e.g. JdbcDrivers=com.mysql.cj.jdbc.Driver.
  4. Recreate the container: docker compose up -d.

Not in modules/

The modules/ folder is for eMondrian modules and license files. JDBC drivers placed there are not found.

Database on the same machine

Inside the container, localhost is the container itself. To reach a database on the Docker host, use host.docker.internal:

jdbc:postgresql://host.docker.internal:5432/mydb

On Linux, also add to the eMondrian service in docker-compose.yml:

extra_hosts:
  - "host.docker.internal:host-gateway"

Database user

eMondrian only reads data. Give it a database user with read-only access to the tables and views your schemas use.

Troubleshooting

  • Catalog doesn’t appear — check element order and &amp; in datasources.xml, then restart.
  • Connection errors — mondrian.log shows the JDBC error. See Logs and Troubleshooting.