页面树结构

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


DatabaseDriversConfluence embeddedName of the Jar file
MySQLhttp://dev.mysql.com/downloads/connector/j/5.1.htmlNomysql-connector-java-x.x.xx-bin.jar
Oraclehttps://confluence.atlassian.com/doc/database-jdbc-drivers-171742.htmlNo

ojdbc7.jar

ojdbc8.jar

SQL Serverhttps://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
PostgreSQLhttp://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. 

  1. Log in as Confluence administrator
  2. Click the cog icon on the right-hand corner. ⚙️  > General Configuration > SVG CHART MACRO > Datasource
  3. All the database connection you have defined are listed in this page. Click "Add New Profile" button
  4. Insert all parameters listed in the table below.

    ParameterDescription
    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 TypeChoose 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 nameClass name of database driver. Example: com.mysql.jdbc.Driver
    HostDatabase address. Example: localhost or 192.168.0.20
    PortDatabase port. Example: 3306
    Database NameThe name you want to access. Example: customer
    UserUser name who can access to the selected database
    PasswordPassword
    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.

  5. 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. 
  • 无标签