Documentation
Space shortcuts

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 On this page:

Table of Contents

Microsoft SQL

Configuring a SQL Server Datasource in Apache Tomcat

Example

Code Block
titleSQL Server Datasource
collapsetrue
<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 in Apache Tomcat

Example

Code Block
titleOracle Datasource
collapsetrue
<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"
/>

MySQL

Configuring a MySQL Datasource in Apache Tomcat

Example

Code Block
titleMySQL Datasource
collapsetrue
<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 in Apache Tomcat

Example

Code Block
titlePostgreSQL Datasource
collapsetrue
<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"
/>

...