> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/install/ms-sql-server-repository-database-archive-installation-legacy-pages/perform-tomcat-specific-connection-tasks/step-2-modify-jdbc-connection-information-in-the-tomcat-context.xml-file-postgresql-archive.md).

# 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 user or password, make sure that you change the password and port number in these examples to match the ones in your configuration 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.

   ```xml
   <Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource"
           factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
           maxActive="20" maxIdle="10" maxWait="10000"
           initialSize="0" username="hibuser" password="password"
           driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
           url="jdbc:sqlserver://localhost:1433;DatabaseName=hibernate;encrypt=true;trustServerCertificate=false"
           validationQuery="select 1"/>
   <Resource name="jdbc/Audit" auth="Container" type="javax.sql.DataSource"
           factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
           maxActive="20" maxIdle="10" maxWait="10000"
           initialSize="0" username="hibuser" password="password"
           driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"        
           url="jdbc:sqlserver://localhost:1433;DatabaseName=hibernate;encrypt=true;trustServerCertificate=false"
           validationQuery="select 1"/>
   <Resource  name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource"
           factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
           initialSize="0" maxActive="20" maxIdle="10" maxWait="10000"
           testOnBorrow="true" username="pentaho_user" password="password"
           driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
           url="jdbc:sqlserver://localhost:1433;DatabaseName=quartz;encrypt=true;trustServerCertificate=false"
           validationQuery="select 1"/>
   <Resource name="jdbc/pentaho_operations_mart" auth="Container" type="javax.sql.DataSource"
           factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
           maxActive="20" maxIdle="10" maxWait="10000"
           initialSize="0" username="pentaho_operations_mart" password="password"
           driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
           url="jdbc:sqlserver://localhost:1433;DatabaseName=pentaho_operations_mart;encrypt=true;trustServerCertificate=false"
           validationQuery="select 1"/>
   <Resource name="jdbc/PDI_Operations_Mart" auth="Container" type="javax.sql.DataSource"
           factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
           maxActive="20" maxIdle="10" maxWait="10000"
           initialSize="0" username="pentaho_operations_mart" password="password"
           driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
           url="jdbc:sqlserver://localhost:1433;DatabaseName=pentaho_operations_mart;encrypt=true;trustServerCertificate=false"
           validationQuery="select 1"/>
   <Resource name="jdbc/live_logging_info" auth="Container" type="javax.sql.DataSource"
           factory="org.pentaho.di.core.database.util.DecryptingDataSourceFactory"
           initialSize="0" maxActive="20" maxIdle="10"
           maxWait="10000" username="dilogs_user" password="password"
           driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
           url="jdbc:sqlserver://localhost:1433;DatabaseName=pentaho_dilogs;encrypt=true;trustServerCertificate=false"
           validationQuery="select 1"/>
   <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"/>
   <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"/>
   <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="com.microsoft.sqlserver.jdbc.SQLServerDriver"
           url="jdbc:sqlserver://localhost:1433;DatabaseName=jackrabbit;encrypt=true;trustServerCertificate=false"
           validationQuery="select 1"/>
   ```

   **Note:** Depending on the configuration of your MS SQL Server, you could set `trustServerCertificate=true` in the above XML code samples. See [Connecting with encryption](https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-with-ssl-encryption?view=sql-server-ver16) for details.
4. Modify the username, password, driver class information, IP address (or domain name), and port numbers to match the correct values for your environment.
5. Comment out any resource references that refer to other databases.
6. Verify that the **validationQuery** parameter for your database is set to: `validationQuery="select 1"`.
7. Save the `context.xml` file, then close it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pentaho.com/install/ms-sql-server-repository-database-archive-installation-legacy-pages/perform-tomcat-specific-connection-tasks/step-2-modify-jdbc-connection-information-in-the-tomcat-context.xml-file-postgresql-archive.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
