You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

After creating the four SHRINE databases and loading their schema, you will then proceed to template the connection file that Tomcat uses for these database connections: context.xml. This file should be placed in the /opt/shrine/tomcat/conf directory.

Here's an example of how a context.xml file should look like. Please remember to change the connection url to your Oracle database schema with the right username and password!

NOTE

The following is for a system running Oracle databases, granted you have already followed the instructions in Chapter 6.1.1.
<?xml version='1.0' encoding='utf-8'?>
<!-- The contents of this file will be loaded for each web application -->

<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Resource name="jdbc/problemDB" auth="Container" type="javax.sql.DataSource"
              maxTotal="100" maxIdle="30" maxWaitMillis="10000"
              username="shrine" password="demouser" driverClassName="com.oracle.jdbc.Driver"
              url="jdbc:oracle:thin:@db.com:1521:ShrineDB"
              testOnBorrow="true" validationQuery="SELECT 1 FROM DUAL" />
 
    <Resource name="jdbc/shrineDB" auth="Container" type="javax.sql.DataSource"
               maxTotal="100" maxIdle="30" maxWaitMillis="10000"
               username="shrine" password="demouser" driverClassName="com.oracle.jdbc.Driver"
               url="jdbc:oracle:thin:@db.com:1521:ShrineDB"
               testOnBorrow="true" validationQuery="SELECT 1 FROM DUAL" />
 
    <Resource name="jdbc/adapterAuditDB" auth="Container" type="javax.sql.DataSource"
              maxTotal="100" maxIdle="30" maxWaitMillis="10000"
              username="shrine" password="demouser" driverClassName="com.oracle.jdbc.Driver"
              url="jdbc:oracle:thin:@db.com:1521:ShrineDB"
              testOnBorrow="true" validationQuery="SELECT 1 FROM DUAL" />
 
    <Resource name="jdbc/qepAuditDB" auth="Container" type="javax.sql.DataSource"
              maxTotal="100" maxIdle="30" maxWaitMillis="10000"
              username="shrine" password="demouser" driverClassName="com.oracle.jdbc.Driver"
              url="jdbc:oracle:thin:@db.com:1521:ShrineDB"
              testOnBorrow="true" validationQuery="SELECT 1 FROM DUAL" />
 
    <Resource name="jdbc/stewardDB" auth="Container" type="javax.sql.DataSource"
              maxTotal="100" maxIdle="30" maxWaitMillis="10000"
              username="shrine" password="demouser" driverClassName="com.oracle.jdbc.Driver"
              url="jdbc:oracle:thin:@db.com:1521:ShrineDB"
              testOnBorrow="true" validationQuery="SELECT 1 FROM DUAL" />
</Context>

 

 

  • No labels