On this page:
Please refer to the Atlassian documentation for the complete information on specific datasources. This page shows example settings of datasources.
Configuring an SQL Server Datasource
Example:
<Resource name="jdbc/myDS" auth="Container" type="javax.sql.DataSource" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://<host>:1433;database=<database-name>" username="<database-user>" password="<password>" maxActive="20" maxIdle="10" maxWait="-1" validationQuery="select 1" /> |
Example
<Resource name="jdbc/myDS" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@<host>:1521:mysid" username="<database-user>" password="<password>" connectionProperties="SetBigStringTryClob=true" maxActive="25" maxIdle="5" maxWait="10000" validationQuery="select 1 from DUAL" /> |
a) In the server.xml file, locate the Context section (under Engine > Host):
<Engine name="Catalina" defaultHost="localhost"> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true"> <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction" factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/> <Manager pathname=""/> <JarScanner scanManifest="false"/> <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="120" /> </Context> |
b) Add a new resource name:
<Resource name="jdbc/oracle" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@<host>:1521:<SID>" username="<database-user>" password="<password>" connectionProperties="SetBigStringTryClob=true" accessToUnderlyingConnectionAllowed="true" maxTotal="60" maxIdle="20" maxWaitMillis="10000"/> |
The final file will look like this:
Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true"> <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction" factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/> <Manager pathname=""/> <JarScanner scanManifest="false"/> <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="120" /> <Resource name="jdbc/oracle" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@<host>:1521:<SID>" username="<database-user>" password="<password>" connectionProperties="SetBigStringTryClob=true" accessToUnderlyingConnectionAllowed="true" maxTotal="60" maxIdle="20" maxWaitMillis="10000"/> </Context> |
5. Once this is done, start Jira.
Configuring a MySQL Datasource
Example
<Resource name="jdbc/myDS" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://<host>/mydatabase?autoReconnect=true" username="<database-user>" password="<password>" maxActive="25" maxIdle="5" maxWait="10000" validationQuery="select 1" /> |
Configuring a PostgreSQL Datasource
Example
<Resource name="jdbc/myDS" auth="Container" type="javax.sql.DataSource" username="confluence" password="confluence" maxActive="100" maxIdle="10" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/confluence" validationQuery="Select 1" /> |