Skip to end of banner
Go to start of banner

Data Source Profiles - 9.x

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

On this page

Description

Data Source Profiles allow the Confluence Administrator to extend Data Sources by providing additional configuration parameters for use by SQL macros. Like Data Sources, Data Source Profiles are referenced by the SQL, SQL-query, and SQL-file Macros using the dataSource parameter.

Note: you must have at least one Data Source in order to begin using this application within Confluence.

Add Data Source Profiles

To add new or extend an existing Data Source Profile: 

  1. Log in as a user with the Confluence Administrators Global Permission.
  2. 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: ).
  3. Select View and Modify Data Source Profiles (see:  ) from the top navigation.
  4. Click on the  button.

The Add Profile screen will provide you with two setup 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 are comfortable constructing a database URL. 

Depending on the setup type, you'll be prompted for the following information.

Setup typeFieldDescription
SimpleDatabase typeThey type of database you are connecting to.
SimpleHostnameThis is the hostname or IP address of your database server.  
SimplePortThis is the port used to access your database on the server it is running against. 
SimpleDatabase This is the name of your database. 
BothDriver classThe class of JDBC driver that you will use to connect to your database (e.g., com.mysql.jdbc.Driver, or org.postgresql.Driver)
BothDriver JAR location

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

Start with an absolute file reference

Usually better 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 stringConnection stringThe database URL is entered in this format (SQLServer example):
jdbc:sqlserver://<hostname>:<port>;database=<database>

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

BothUsernameThis is the username of your dedicated database user. 
BothPasswordThis is the password for your dedicated database user.

Extended Parameters

Data Source Profiles allow for the configuration of extended parameter options. These profile-wide settings will be used by all SQL Macros if not overridden at the Macro-level.

Table: extended parameter options explained

ParameterMacro ParameterDefaultDescription
Limit rows processedlimitNo 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:

  • No limit
  • 250 - Recommended
  • 500
  • 1000
  • 2500
  • 5000
  • 10000
  • 15000
Limit query timequeryTimeoutNo 

View Data Source Profiles

To view, add, or modify a Data Source Profile:

  1. Log in as a user with the Confluence Administrators Global Permission.
  2. 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: ).
  3. Select View and Modify Data Source Profiles (see:  ) from the top navigation.
  4. You will see a list of Data Source Profiles and their connection status.


Security

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 Macro Security for Confluence and configuring access to the macro and perhaps to individual profiles. 

Parameters


Copy and paste the configuration into your data source profile configurationQuick Configurations

  1. Change the name to something meaningful for your organization
  2. Modify the url to your database server
  3. Modify the database name (from test to the name of database you want to query)
  4. Modify the user and password to be match the user credentials defined for the the database server
  5. To test: create a page and use Insert -> Markup to add the following wiki markup : {sql-query:dataSource=example} select 1 {sql-query}


dataSource not found

All 5 db parameters are required when defining db access directly. Otherwise you will likely get a dataSource not found message.

Using the lib location

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.




  • No labels