Perform Tomcat-specific connection tasks

After your repository has been configured, you must configure the web application servers to connect to the Pentaho Repository. In this step, you will make JDBC and JNDI connections to the Hibernate, Jackrabbit, and Quartz components.

Note: By default, the Pentaho Server software is configured to be deployed and run on the Tomcat server. As such, connections have already been specified and the Tomcat context.xml file must be modified ONLY if you have changed the default ports or passwords.

Use these steps to set up the JDBC driver and update the Tomcat connection settings.

Step 1: Download driver and apply to the Pentaho Server

To connect to a database, including the Pentaho Repository database, you must download and copy a JDBC driver to the appropriate places for the Pentaho Server and the web application server.

Note: Due to licensing restrictions, Pentaho cannot redistribute some third-party database drivers. You must download and install the file yourself.

  1. Download a JDBC Driver JAR from your database vendor or a third-party driver developer.

    The JDBC drivers reference has a list of supported drivers.

  2. Copy the JDBC driver JAR you downloaded to the pentaho/server/pentaho-server/tomcat/lib folder.

  3. Copy the hsqldb-2.3.2.jararrow-up-right file to pentaho-server/tomcat/lib if you want to retain the sample provided by Pentaho.

Step 2: Modify JDBC connection information in the Tomcat XML file

Database connection and network information, such as the username, password, driver class information, IP address or domain name, and port numbers for your Pentaho Repository database are stored in the context.xml file. Modify this file to reflect the database connection and network information for your operating environment.

Caution: If you have a different port, password, user, driver class information, or IP address, change the values in these examples to match your environment.

  1. Consult your database documentation to determine the JDBC class name and the connection string for your Pentaho Repository database.

  2. Navigate to the server/pentaho-server/tomcat/webapps/pentaho/META-INF directory and open the context.xml file with any text editor.

  3. Add the following code to the file if it does not already exist. Replace XE in the URL setting with your schema name.

    <Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="hibuser" password="password" driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"
            jdbcInterceptors="ConnectionState" defaultAutoCommit="true"/>
    <Resource name="jdbc/Audit" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="hibuser" password="password" driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/>
    <Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="quartz" password="password" testOnBorrow="true"
            driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/>
    <Resource name="jdbc/PDI_Operations_Mart" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="pentaho_operations_mart" password="password"
            driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/>
    <Resource name="jdbc/pentaho_operations_mart" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="pentaho_operations_mart" password="password"
            driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/>
    <Resource name="jdbc/live_logging_info" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="pentaho_dilogs" password="password"
            driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521/XE" validationQuery="select 1 from dual"/>
    <Resource name="jdbc/SampleData" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="pentaho_user" password="password"
            driverClassName="org.hsqldb.jdbcDriver"
            url="jdbc:hsqldb:hsql://localhost/sampledata"
            validationQuery="select 1 from dual"/>
    <Resource name="jdbc/SampleDataAdmin" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="pentaho_admin" password="password"
            driverClassName="org.hsqldb.jdbcDriver"
            url="jdbc:hsqldb:hsql://localhost/sampledata"
            validationQuery="select 1 from dual"/>
    <Resource name="jdbc/jackrabbit" auth="Container" type="javax.sql.DataSource"
            factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
            maxActive="20" minIdle="0" maxIdle="5" initialSize="0" maxWait="10000"
            username="jcr_user" password="password"
            driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521/XE"
            validationQuery="select 1 from dual"/>
  4. Modify the username, password, driver class information, IP address (or domain name), and port numbers to match your environment.

  5. Comment out any resource references that refer to other databases.

  6. Verify that the validationQuery variable for your database is set to validationQuery="select 1 from dual".

  7. Save the context.xml file, then close it.

Last updated

Was this helpful?