Configure Data Source Profiles - 11.x

Configure Data Source Profiles - 11.x

On this page

Overview

SQLSQL File, and SQL Query macros use data sources to connect to and access your databases. Creating one or more data source profiles is the fastest and most convenient method of establishing a connection. You can also create data source profiles that extend data sources configured within your application server.

You must provide at least one data source to use this app within Confluence.

From version 10.3:

All profile sensitive information (such as passwords) are now encrypted to provide enhanced security. This encryption-decryption of profile passwords is not available if the app is downgraded from version 10.3 to a lower release version. If you must downgrade the app version, passwords of all the profiles must be re-entered to ensure proper working of profiles.

Add data source profiles

To add a new or extend an existing data source or global data source (defined in server.xml) profile: 

  1. Log in as a Confluence administrator with Global Permission.

  2. Select Manage apps from the CONFLUENCE ADMINISTRATION menu (cog icon: cog.png ) at the top right of your screen.

  3. Scroll down to BOB SWIFT CONFIGURATION in the navigation pane to the left and click SQL (Pro Edition) (seeSQL_Config.jpg ).

  4. Click View and modify data source profiles tab at the top.

  5. Click the Add profile button (1).png button.

  6. The Add profile screen provides you with two setup type options:

    • Simple - this is the most straightforward way to connect to your database.

    • By connection string - use this option if you want to specify additional parameters and you are comfortable with constructing a database URL.

Setup options

Depending on the setup type, you are prompted to enter the following information:

Setup Type

Field

Description

Setup Type

Field

Description

Simple

Database type

The type of database you are connecting to.

Simple

Data source name

You have the option to create a new data source profile by extending an existing data source.  This may be useful if you'd like to tighten/alter the configuration parameter settings to be more/less restrictive for certain usage. You can of course then secure the usage using our Macro Security for Confluence app.

Simple

Hostname

This is the hostname or IP address of your database server.  

Simple

Port

This is the port used to access your database on the server it is running against. 

Simple

Database 

This is the name of your database. 

Both

Driver class

The class of JDBC driver that you will use to connect to your database (e.g., com.mysql.jdbc.Driver, or org.postgresql.Driver).

Both

Driver JAR location

The path on your Confluence server where the JDBC driver is located.

Start with an absolute file reference

Usually, it is desirable to start with an absolute reference to make sure it is working. Relative references are more maintainable but can be problematic especially on Windows. After it is working, you can experiment with relative references.

By connection string

Connection string

The database URL is entered in this format (SQL Server example):

jdbc:sqlserver://<hostname>:<port>;database=<database>

For example:  
jdbc:sqlserver://yourserver:1433;database=confluence

  • SQL for Confluence version 11.0.7 and above supports Connection string URL of unlimited length.

  • SQL for Confluence version 11.0.6 and below supports Connection string URL of length less than or equal to 255 characters. 

Once you select the By connection string option and start filling in the details of the Connection string field, the Simple (recommended) Setup type is disabled (for you to switch to Simple). If you want to enable the Simple option, empty the details in the Connection string field.

Both

Username

This is the username of the database you provided. 

Both

Password

This is the password of the database you provided. 

Quick connection strings

When using the By connection string setup option, the following examples can be quickly copied into the relevant sections and then modified:

Database

Example

Database

Example

PostgreSQL

dbUrl=jdbc:postgresql://localhost:5432/test | dbUser=confluence | dbPassword=confluence | dbDriver=org.postgresql.Driver | dbJar=https://jdbc.postgresql.org/download/postgresql-42.2.5.jar

PostgreSQL (using specific Schema)

dbUrl=jdbc:postgresql://localhost:5432/test?currentSchema=jiraschema | dbUser=confluence | dbPassword=confluence | dbDriver=org.postgresql.Driver | dbJar=https://jdbc.postgresql.org/download/postgresql-42.2.5.jar 

MySQL

dbUrl=jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=utf8&amp;allowMultiQueries=true | dbUser=confluence | dbPassword=confluence | dbDriver=com.mysql.jdbc.Driver | dbJar=http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar

Microsoft SQL Server

dbDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver | dbUrl=jdbc:sqlserver://localhost:2433;database=test;integratedSecurity=false | dbUser=confluence | dbPassword=confluence | dbJar=../lib/mssql-jdbc-7.0.0.jre8.jar

The configuration for other databases (other than the ones listed in the table above) is similar to the information found in the examples section on: Configure Application Server Based Data Sources.

Extended parameters

Data source profiles allow for the configuration of extended parameter options. These profile-wide settings are used by all SQL macros if not overridden at the macro-level.

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.