Versions Compared

Key

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


Div
idProductTOC

On this page

Table of Contents
maxLevel1
excludeOn this page
typeflat
separatorpipe

...

Modify <install-dir>/conf/server.xml to add one or more Data Source resource elements. server.xml is an example of adding a few Data Sources for various local and non-local databases.

The essential element is something looks like the following sample code mentioned below, where the Data Source name is myDS:

xml
Code Block
xml
<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"
/>

...

Tip
titleConsider using a validation query

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


...

Database Examples

The sql SQL macro markup would be: {sql:dataSource=myDS| ... }  

See Examples - 910.x.

Further Configuration Management

See How to to limit active database connections.

Other Databases

Support for other databases depends on the capabilities provided by the JDBC driver. SQL expects requires that certain JDBC features to be are available. In some cases, parameter choices can affect which capabilities are needed. User testing and community support is about are the only help that is resources available for less popular databases/JDBC drivers. If you have had success with other databases, please add information to mention the same on this page.

...

Problem determination

See See Troubleshooting Application Server-based Data Sources - 910.x.

Include Page
info:css - pre formatted
info:css - pre formatted