SINCE V1.3.0
SVG Chart Macro can retrieve data from your database and generate statistic chart in a Confluence page.
Supported database type:
- Mysql
- SQL Server
- PostgreSQL
- Oracle
Database connector driver
You need database connector file to access relevant database from Confluence.
By default, Confluence provide database connectors for SQL Server and PostgreSQL. If you prefer to user MySQL database or Oracle database, you need to download driver for your database and upload to <Confluence installation directory>/confluence/WEB-INF/lib
Database | Drivers | Confluence embedded | Name of the Jar file |
---|---|---|---|
MySQL | http://dev.mysql.com/downloads/connector/j/5.1.html | No | mysql-connector-java-x.x.xx-bin.jar |
Oracle | https://confluence.atlassian.com/doc/database-jdbc-drivers-171742.html | No | ojdbc7.jar ojdbc8.jar |
SQL Server | https://docs.microsoft.com/en-us/sql/connect/jdbc/microsoft-jdbc-driver-for-sql-server?view=sql-server-2017 | Yes <Confluence home>/confluence/WEB-INF/lib | jtds-x.x.x.jar |
PostgreSQL | http://jdbc.postgresql.org/ | Yes <Confluence home>/confluence/WEB-INF/lib | postgresql-xx.x.x.jar |
Set up database connection
To retrieve data from database, you need to set up database connection first.
- Log in as Confluence administrator
- Click the cog icon on the right-hand corner. ⚙️ > General Configuration > SVG CHART MACRO > Datasource
- All the database connection you have defined are listed in this page. Click "Add New Profile" button
Insert all parameters listed in the table below.
Parameter Description Name Customized database connection name. The name must be unique.
You can put this name into Title of Code Macro to generate chart from this datasource.
Database Type Choose the type of the database you want to connect to Database connector driver path Input absolute path and file name of database driver. Example:
/opt/atlassian/confluence/confluence/WEB-INF/lib/mysql-connector-java-5.1.47-bin.jar
Class name Class name of database driver. Example: com.mysql.jdbc.Driver Host Database address. Example: localhost or 192.168.0.20 Port Database port. Example: 3306 Database Name The name you want to access. Example: customer User User name who can access to the selected database Password Password Extended - Max Rows Sets the limit for the maximum number of rows that extracted from the database. Default value is 500.
Please Note that if you increase this value, it may cause to performance degradation.
Extended - Query timeout(s) Limits the number of seconds a JDBC driver waits for a statement to execute. Default value is 30.
Please Note that if you increase this value and the query is complex, it may cause performance degradation.
- Fill in above data and click 'Save' button. SVG chart macro will test test target database. If successfully connected, the database configuration will be saved. Otherwise, you need to modify the parameters until the database can be accessed successfully.