Skip to main content
Skip table of contents

Datasources

A datasource can be a JDBC Connection to a SQL database or a REST API with different authentication options.

JDBC Datasources

A JDBC datasource consists of the following properties:

  • Name: The name identifying the database. Names must start with a letter and only contain letters [A-Za-z_-], numbers, hyphens and underscores.

  • URL: The JDBC-formatted URL of the database. See the list below.

  • Driver: The JDBC database driver, see the table below. If you have already filled in a valid URL before, PocketQuery will recognize that and filled this field out automatically.

  • User: The database username. (Note: As PocketQuery is designed to be a read-only tool, we recommend to use a user with only reading permissions for a clean setup.)

  • Password: The database user password.

You can click the Test Connection button below the form to test your database connection.

Note: Jira already comes with a bundle of JDBC drivers but, depending on the type of SQL database you want to query, you might need to add another one. Check the list of supported databases  and if necessary download the driver, add it to your atlassian-jira-software-7.11.2/lib directory and restart Jira.

List of drivers and their respective URL syntax

Type

Driver

URL Syntax

MySQL

com.mysql.jdbc.Driver

jdbc:mysql://hostname:port/databaseName

PostgreSQL

org.postgresql.Driver

jdbc:postgresql://host:port/database

Microsoft SQL Server

com.microsoft.sqlserver.jdbc.SQLServerDriver

jdbc:sqlserver://server:port/databaseName

ORACLE

oracle.jdbc.driver.OracleDriver

jdbc:oracle:thin:@hostname:port Number:databaseName

DB2

COM.ibm.db2.jdbc.net.DB2Driver

jdbc:db2:hostname:port Number/databaseName

Sybase

com.sybase.jdbc.SybDriver

jdbc:sybase:Tds:hostname: port Number/databaseName

JNDI Datasources

A JNDI datasource consists of two properties only:

  • Name: The name identifying the database. Names must start with a letter and only contain letters [A-Za-z_-], numbers, hyphens and underscores.

  • Resource name: Name of the JNDI resource that should be used. It needs to be set up beforehand. Make sure to include the context as prefix to the actual given name - in most cases this will be "java:comp/env/".

You can click the Test Connection button below the form to test your database connection.

A JNDI datasource requires quite some configuration beforehand as the connection details must be stored somewhere in the environment (i.e. your Tomcat server). If you do not know of any JNDI resources that already exist we would recommend to use a standard JDBC datasource.

If you think JNDI could still be useful talk to your server administrator and your database administrator about setting one up. You can start by reading Atlassian's Guide on how to configure a JNDI connection (expecially steps 1 to 3 are relevant), for example.

REST Datasources

You can configure arbitrary REST APIs as datasources. As the settings of the datasource and further processing can largely differ depending on the REST API used we also provide a list of REST examples for various services.

There are three types of REST datasources available in PocketQuery. All of them share the fields:

  • Name: The name identifying the datasource. Names must start with a letter and only contain letters [A-Za-z_-], numbers, hyphens and underscores.

  • Type: Type of the REST datasource.

  • URL: Base URL that indicates where the REST endpoint is located. The URLs you set for each query will then be appended to this base URL.

  • Test URL: The test URL is optional and only needed to verify the connection settings when clicking on “Test connection”.

Additional fields differ for each type of REST datasource:

  • REST Basic: Uses basic authentication requiring username and password.

  • REST Application Link: Only works with Jira Application Links, that have to be configured in the Jira administration. Does not require further authentication information, as the connection via the link is already established with OAuth.

Please make sure the application link uses the authorization type OAuth with impersonation. (Please refer to the Atlassian documentation to learn about the differences between OAuth with or without impersonation.)

  • REST Custom: Allows to set arbitrary request parameters and headers.

You can click the Test Connection button below the form to test your REST connection, if you included a test url.

Continue with Queries

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.