Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
On this page
|
...
- Log in as a user with the Confluence Administrators Global Permission.
- Select Add-ons from the Administration menu (cog icon: ) at the top right of your screen. Then scroll down to Bob Swift Configuration on the left-hand nav bar and choose SQL Configuration (see: ).
- Select View and Modify Data Source Profiles (see: ) from the top navigation.
- Click on the button.
The Add Profile screen will provide you with two setup options:
...
Parameter | Macro Parameter | Default | Description | |||||
---|---|---|---|---|---|---|---|---|
Limit rows processed | limit | No limit | The maximum number of rows that will be processed and displayed by SQL macros. This prevents queries that result in a large number of rows from using excessive resources. Individual queries can use the limit parameter to override this value. The following options are available for selection:
| |||||
Limit query time | queryTimeout | None | The number of seconds that a query can take before we force a timeout. This prevents queries that take too long from impacting other users. Individual queries can use the queryTimeout parameter to override this value.
| |||||
Limit max active | maxActive | Noone | Used to limit the number of actively executing SQL queries for a specific data source. Once the maximum active limit is reached, the next requested render of a sql macro using the specific data source will return an error message instead of trying to connect to the database. See this article for additional information. | |||||
Show sql options | showSqlOptions | None | Since 6.4. A comma separated list of code or code-pro (Code Pro Macro) parameters used when Show SQL is selected. This allows for customization of how the SQL code is shown. See How to improve the display of SQL source. | |||||
Connection properties | connectionProperties | None | A list of driver specific properties passed to the driver for creating connections. Each property is given as name=value , multiple properties are separated by semicolons (; ). See Apache Tomcat JNDI resources. | |||||
Initial SQLs | initalSql<n> | None | SQL that is run after the SQL connection is established where n is a number (1, 2, 3, ...). Multiple initial SQL statements are allowed to support databases that only allow single SQL statements. Example use for Oracle:
No results are kept and any errors will generate a macro exception. Using beforeSql is recommended for Postgres and other database that support multiple sql statements as it is more efficient than multiple separated actions. | |||||
Before SQL | beforeSql | None | SQL that is added before Macro defined SQL. | |||||
After SQL | afterSql | None | SQL that is added after Macro defined SQL. |
...
Data sources are shared resources. Some of these resources may need to be secured for use only by specific users or groups. This can be accomplished by using CMSP and configuring access to the macro and perhaps to individual profiles.
Parameters
...
SQL that is run after the SQL connection is established where n is a number (1, 2, 3, ...). Multiple initial SQL statements are allowed to support databases that only allow single SQL statements. Example use for Oracle:
Code Block | ||
---|---|---|
| ||
initialSql1=ALTER SESSION SET NLS_TERRITORY = GERMANY|initialSql2=ALTER SESSION SET NLS_LANGUAGE = GERMAN |
No results are kept and any errors will generate a macro exception. Using beforeSql is recommended for Postgres and other database that support multiple sql statements as it is more efficient than multiple separated actions.
...
SQL that is added after macro defined SQL.
...
org.postgresql.Driver
...
Location of the JDBC jar file. Required unless an application data source is referenced by the dataSource parameter.
- Relative file reference in installation directory on Confluence server
- Example: lib/postgresql-9.2-1000.jdbc4.jar
- Absolute file reference on Confluence server
- Example: /atlassian/confluence/lib/postgresql-9.2-1000.jdbc4.jar
- URL reference (slow!)
- Fully qualified jar reference (JAR URL reference)
- Example: jar:file:lib/postgresql-9.2-1000.jdbc4.jar!/
...
title | Start with an absolute file reference |
---|
...
Copy and paste the configuration into your data source profile configurationQuick Configurations
...