Skip to main content
Skip table of contents

How to configure a Datasource


Please refer to the Atlassian documentation for the complete information on specific datasources. This page shows example settings of datasources.

Microsoft SQL Server

Configuring an SQL Server Datasource

Example:

SQL Server Datasource
CODE
<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"
/>


Oracle

Configuring an Oracle Datasource for Confluence

Example

Oracle Datasource
CODE
<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"
/>

Configuring an Oracle Datasource for Jira

  1. Stop Jira.

  2. Download the Oracle JDBC Driver
    https://www.oracle.com/webapps/redirect/signon?nexturl=https://download.oracle.com/otn/utilities_drivers/jdbc/122010/ojdbc8.jar
    (you need to create an account)

  3. Copy it to your Jira Folder: /opt/atlassian/jira/application/lib

  4. Edit the Server.xml: /opt/atlassian/jira/application/conf

a) In the server.xml file, locate the Context section (under Engine > Host):

CODE
<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:

CODE
<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:

CODE
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.


MySQL

Configuring a MySQL Datasource

Example

MySQL Datasource
CODE
<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"
/>


PostgreSQL

Configuring a PostgreSQL Datasource

Example

PostgreSQL Datasource
CODE
<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"
/>

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.