Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
On this page
|
Description
SQL Macros such as SQL, SQL-query, and SQL-file use Data Sources to connect 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.
Info |
---|
Note: you must have at least one Data Source in order to begin using this application within Confluence. |
...
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. |
...
- 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.
- You will see a list of Data Source Profiles and their connection status.
- Click on the edit link to the right of the Data Source Profile you would like to modify.
- The edit dialog will appear and will default to the "By connection string" view. You can edit in place or toggle to the "Simple" setup type and make necessary changes.
- To save changes, click on the Next button (see: ) and then the Save Profile (see: ) button.
Security
...
Remove Data Source Profiles
To view, add, or modify a Data Source Profile:
- 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.
- You will see a list of Data Source Profiles and their connection status.
- Click on the remove link to the right of the Data Source Profile you would like to remove.
- When prompted, just confirm or exit.
Warning |
---|
Removing Data Source Profiles extended by SQL Macros will render the Macro and section of the page broken. |
Copy and paste the configuration into your data source profile configurationQuick Configurations
...
Table plus | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
The configuration for other databases is similar to the information found in the examples section on: Data source configuration - application server. |
Tip | ||
---|---|---|
| ||
All 5 db parameters are required when defining db access directly. Otherwise you will likely get a dataSource not found message. |
Tip | ||
---|---|---|
| ||
Often, using the lib location (example: dbJar=lib/ojdbc6.jar)is best especially if you already have or later intend to define an application server based data source. The following is for a standalone installation. |