Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: how to set jdbc properties on Mondrian's xmla datasources.xml

  1. #1
    Join Date
    Jul 2010

    Default how to set jdbc properties on Mondrian's xmla datasources.xml

    I'm getting ? instead of unicode characters in my resultsets from mondrian via xmla. My problem is similar to the one described in this post:

    The solution described in the previous post says to set some jdbc properties on the connection url.
    Now I add "useUnicode=true&characterEncoding=UTF-8" in my JDBC data source connection, and it works like a charm!
    However, the datasources.xml for that connection won't accept url params. Instead the mondrian documentation suggests that i should be able to do this in my datasources.xml using properties with the prefix "jdbc.*"

    It doesn't seem to have any affect. Here's an excerpt from my WEB-INF/datasources.xml:
    <DataSourceInfo>Provider=Mondrian; Jdbc=jdbc:mysql://localhost/mydb; jdbc.useUnicode=true; jdbc.characterEncoding=UTF-8; jdbc.characterSetResults=UTF-8; JdbcUser=myuser; JdbcPassword=mypass; JdbcDrivers=com.mysql.jdbc.Driver;</DataSourceInfo>
    Can anyone see why Mondrian wouldn't use these "jdbc.*" properties?

    I can tell it's not using it I've turned on mondrian sql debugging and i can see it looking up the member by name using ? instead of unicode.

  2. #2
    Join Date
    Dec 2009



    maybe I use a more complicated approach, but usually I do the following:
    - create a JNDI-Datasource from PAC
    - make mondrian use the JNDI-Datasource

    From inside the PAC you are required to specify the JDBC-URL, thus this is the most obvious point where your properties could/should go to...

    What do you think about this approach?



  3. #3
    Join Date
    Jul 2010


    Thanks for the reply Tom. I'm actually using Mondrian deployed to Tomcat, so i don't have a full Pentaho installation. However i like the idea of using a JNDI datasource. I've got one configured for jpivot that i think i can reuse. I'll let you know how it goes.

  4. #4
    Join Date
    Jul 2010


    Cool. The ultimate solution was to configure the DefaultXmlaServlet to use UTF-8 encoding
    Got that from this post:

    But i also took your advice on using a JNDI datasource. I liked the idea of having only one definition for my datasource.

    My datasources.xml now simply refers to the same jndi connection i set up for jpivot
    My context.xml looks like this:
    <Context reloadable="false" crossContext="false" path="/Mondrian">
      <Resource name="jdbc/yield" auth="Container" type="javax.sql.DataSource"
               maxActive="100" maxIdle="30" maxWait="180000"
               username="myuser" password="mypass" driverClassName="com.mysql.jdbc.Driver"
    Thanks for the help!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.