Date: Thu, 28 Mar 2024 12:42:56 -0400 (EDT) Message-ID: <1201000763.774.1711644176263@prodopencatalystconfluence.catalyst> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_773_1953271840.1711644176259" ------=_Part_773_1953271840.1711644176259 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Tomcat uses its context.xml file to create database connection p= ools and to find the database. Shrine-setup.zip contains a sample context.x= ml file. Copy that file to /opt/shrine/tomcat/conf&nb= sp;and modify it as needed.
Here's an example of a context.xml file for a local mariaDB:
<?xml= version=3D'1.0' encoding=3D'utf-8'?> <!-- The contents of this file will be loaded for each web application -= -> <Context> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Resource name=3D"jdbc/problemDB" auth=3D"Container" type=3D"javax.s= ql.DataSource" maxTotal=3D"128" maxIdle=3D"32" maxWaitMillis=3D"10000" username=3D"shrine" password=3D"demouser" driverClassName=3D"= com.mysql.jdbc.Driver" url=3D"jdbc:mysql://localhost:3306/shrine_query_history?serve= rTimezone=3DUTC" testOnBorrow=3D"true" validationQuery=3D"SELECT 1" /> <Resource name=3D"jdbc/shrineDB" auth=3D"Container" type=3D"javax.sq= l.DataSource" maxTotal=3D"128" maxIdle=3D"32" maxWaitMillis=3D"10000" username=3D"shrine" password=3D"demouser" driverClassName=3D"= com.mysql.jdbc.Driver" url=3D"jdbc:mysql://localhost:3306/shrine_query_history?serve= rTimezone=3DUTC" testOnBorrow=3D"true" validationQuery=3D"SELECT 1" /> <Resource name=3D"jdbc/adapterAuditDB" auth=3D"Container" type=3D"ja= vax.sql.DataSource" maxTotal=3D"128" maxIdle=3D"32" maxWaitMillis=3D"10000" username=3D"shrine" password=3D"demouser" driverClassName=3D"= com.mysql.jdbc.Driver" url=3D"jdbc:mysql://localhost:3306/adapterAuditDB?serverTimez= one=3DUTC" testOnBorrow=3D"true" validationQuery=3D"SELECT 1" /> <Resource name=3D"jdbc/qepAuditDB" auth=3D"Container" type=3D"javax.= sql.DataSource" maxTotal=3D"512" maxIdle=3D"32" maxWaitMillis=3D"10000" username=3D"shrine" password=3D"demouser" driverClassName=3D"= com.mysql.jdbc.Driver" url=3D"jdbc:mysql://localhost:3306/qepAuditDB?serverTimezone= =3DUTC" testOnBorrow=3D"true" validationQuery=3D"SELECT 1" /> <Resource name=3D"jdbc/stewardDB" auth=3D"Container" type=3D"javax.s= ql.DataSource" maxTotal=3D"128" maxIdle=3D"32" maxWaitMillis=3D"10000" username=3D"shrine" password=3D"demouser" driverClassName=3D"= com.mysql.jdbc.Driver" url=3D"jdbc:mysql://localhost:3306/stewardDB?serverTimezone= =3DUTC" testOnBorrow=3D"true" validationQuery=3D"SELECT 1" /> </Context>
For MariaDB you will need to use an appropriate driver. In = our tests, we have had success with the MySQL Connector/J driver from&= nbsp;https://d= ev.mysql.com/downloads/connector/j/. The jar file we used was mysql-connector-java-5.1.38-bin.jar. It should be= installed under /opt/shrine/tomcat/lib.
For MS SQL Server, you will need to use an appropriate driv= er and url for your database. In our tests, we have had success with the JT= S driver from https://source= forge.net/projects/jtds/files/. The jar file we used was jt= ds-1.3.1.jar. It should be installed under /opt/shrine/tomcat/= lib.
driverClassName= =3D"net.sourceforge.jtds.jdbc.Driver"
The URL we use looks like this:
url=3D"jdbc:jtds:= sqlserver://mssql.abcdefghijkl.us-east-1.rds.amazonaws.com:1433/adapterAudi= tDB"
For Oracle, you will need to use an appropriate driver and url for your = database. The driver must support JDK 11 and later. We test internally with= ojdbc10.jar and recommend using that version. ojdbc8.jar is also cer= tified by Oracle to work with JDK 11.
The driver should be installed under /opt/shri= ne/tomcat/lib, and the following driver name should be used for al= l Oracle connections in context.xml:
driverClassName= =3D"oracle.jdbc.OracleDriver"
The URL we use looks like this:
url=3D"jdbc:oracl= e:thin:@oracle.abcdefghijkl.us-east-1.rds.amazonaws.com:1521:SHRINEDB"
We also changed the validationQuery:
validationQuery= =3D"SELECT 1 FROM DUAL"
For Oracle, you will need to use an appropriate driver and url for your = database. The driver must support JDK 11 and later. We test internally= with ojdbc10.jar and recommend using that version. ojdbc8.jar is als= o certified by Oracle to work with JDK 11