Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

SQL for Confluence
Results will update as you type.
  • Get started
  • Data Center 11.x
    • Help and support - 11.x
    • Use cases - 11.x
    • Macro Reference - 11.x
    • Key Concepts - 11.x
    • Overview - Data Center 11.x
    • Installation and configuration - Data Center
      • Installation - 11.x
      • Configuration - 11.x
        • Configure Application Server Based Data Sources - 11.x
          • Examples - 11.x
        • Configure Data Sources - 11.x
        • Configure Data Source Profiles - 11.x
  • Cloud
  • Release notes
  • Help and support
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    Configure Application Server Based Data Sources - 11.x
    Updated Aug 05

    Configure Application Server Based Data Sources - 11.x

    On this page

    Summary

    Confluence installation with Tomcat

    Many users install the standard Confluence standalone distribution that includes Tomcat. This section will discuss the configuration specific to this application server environment. The most recent versions of Confluence use newer versions of the Tomcat application server where the following configuration examples apply:

    JDBC driver location

    Put the driver jar in <install-dir>/lib - this is the directory that holds other tomcat jars. If you have a much older version of Confluence without this directory, look for <install-dir>/common/lib instead.

    Tomcat configuration

    Modify <install-dir>/conf/server.xml to add one or more data source resource elements. Server.xml is an example of adding data sources for various local and non-local databases.

    The essential element looks like the sample code mentioned below, where the data source name is myDS:

    <Resource name="jdbc/myDS" auth="Container" type="javax.sql.DataSource" username="confluence" password="confluence" maxTotal="25" maxWaitMillis="10000" maxIdle="10" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/mydatabase" validationQuery="Select 1" />

    Resource must be within the confluence context tag

    ... <Context path="" docBase="../confluence" debug="0" reloadable="false"> ... <Resource ... /> ... </Context>

    Consider using a validation query

    Refer to this stack overflow question, to know more about validationQuery with respect to a JNDI data source.

    Database examples

    The SQL macro markup will look like: {sql:dataSource=myDS| ... }  See Examples - 11.x.

    Further configuration management

    See how to limit active database connections.

    Other databases

    Support for other databases depends on the capabilities provided by the JDBC driver. SQL for Confluence requires that certain JDBC features are available. In some cases, choosing certain parameter options can affect the capabilities. User testing and community support are the only help resources available for less popular databases or JDBC drivers. If you have had success with other databases, let us know about the method in your comments on this page.

    Problem determination

    See Troubleshooting Application Server Based Data Sources - 11.x.





    Need support? Create a request with our support team.

    Copyright © 2005 - 2025 Appfire | All rights reserved.

    {"serverDuration": 14, "requestCorrelationId": "1926f2223b9b4acd9f06c15d04eae65f"}