Adding a JNDI Data Connection to Tomcat

If you would prefer to use a JNDI connection to your database instead of the standard Pentaho method, follow the instructions below:

  1. Consult the list of JDBC class names to determine the class name and connection string for your database.
  2. Stop the Tomcat server by running the stop-pentaho script.
  3. Edit the /pentaho/server/biserver-ee/tomcat/conf/server.xml with a text editor.
  4. Anywhere inside of the <host> element, add the XML snippet shown below:
    <Context path="/pentaho" docbase="webapps/pentaho/">
        <Resource name="jdbc/myDataSource" auth="Container" type="javax.sql.DataSource"
        factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5"
        maxWait="10000" username="dbuser" password="password" driverClassName="org.postgresql.Driver"
        url="jdbc:postgresql://127.0.0.1:5432/myDataSource" />
    </Context>
    The above example shows a simple PostgreSQL configuration. Replace the Resource name, username, password, driverClassName, and url parameters (or any relevant connection settings) to match your connection information.
  5. Save and close the server.xml file.
  6. Start the Tomcat server by running the start-pentaho script.
Tomcat can now properly connect to your database.
Related information
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html