<<

Progress DataDirect for JDBC for Jira Quick Start

6.0.0 Release

Copyright

© 2019 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved. These materials and all Progress® software products are copyrighted and all rights are reserved by Progress Software Corporation. The information in these materials is subject to change without notice, and Progress Software Corporation assumes no responsibility for any errors that may appear therein. The references in these materials to specific platforms supported are subject to change. Corticon, DataDirect (and design), DataDirect Cloud, DataDirect Connect, DataDirect Connect64, DataDirect XML Converters, DataDirect XQuery, DataRPM, Deliver More Than Expected, Icenium, Kendo UI, Kinvey, NativeScript, OpenEdge, Powered by Progress, Progress, Progress Software Developers Network, Rollbase, SequeLink, Sitefinity (and Design), Sitefinity, SpeedScript, Stylus Studio, TeamPulse, Telerik, Telerik (and Design), Test Studio, and WebSpeed are registered trademarks of Progress Software Corporation or one of its affiliates or subsidiaries in the U.S. and/or other countries. Analytics360, AppServer, BusinessEdge, DataDirect Autonomous REST Connector, DataDirect Spy, SupportLink, DevCraft, Fiddler, JustAssembly, JustDecompile, JustMock, NativeChat, NativeScript Sidekick, OpenAccess, ProDataSet, Progress Results, Progress Software, ProVision, PSE Pro, SmartBrowser, SmartComponent, SmartDataBrowser, SmartDataObjects, SmartDataView, SmartDialog, SmartFolder, SmartFrame, SmartObjects, SmartPanel, SmartQuery, SmartViewer, SmartWindow, and WebClient are trademarks or service marks of Progress Software Corporation and/or its subsidiaries or affiliates in the U.S. and other countries. Java is a registered trademark of Oracle and/or its affiliates. Any other marks contained herein may be trademarks of their respective owners.

Updated: 2019/07/01

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 3 Copyright

4 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 Quick Start: Progress DataDirect for JDBC for Jira Driver

The Progress® DataDirect® for JDBC™ for Jira™ Driver (Jira driver) supports SQL read-only access for JDBC applications to Atlassian Jira. This quick start guide provides the basic information necessary to install, configure, and connect to Jira data sources. To take full advantage of the features and functionality available for your driver, refer to the product documentation library at: Progress DataDirect Documentation Library

Note: OEM CUSTOMERS: Refer to the Progress DataDirect for JDBC Drivers Distribution Guide for information on installing, branding, unlocking, and distributing your branded drivers.

This quick start covers the following topics:

• Before you start on page 5 • Requirements and support on page 6 • Downloading the driver on page 6 • Installing the JDBC driver on page 7 • Setting the classpath on page 9 • Driver and classes on page 9 • Using connection properties on page 9 • Connecting to a DataSource on page 10 • Troubleshooting setup/connection issues on page 18 • Additional resources on page 19

Before you start

Before you get started, you need the following:

• Appropriate user permissions to modify your environment and to read, write, and execute various files in the DataDirect for JDBC installation directory. • Connection information: • User Name: The user ID used to access your Jira account. • API Token (Recommended) or Password: The token used to authenticate REST API requests with Jira or the password used to access your Jira account. For information on generating a token, refer to the Jira documentation.

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 5 Chapter 1: Quick Start: Progress DataDirect for JDBC for Jira Driver

Note: Using your JIRA password can result in authentication failures in some scenarios. To avoid this issue, we recommend specifying a Jira API Token in place of your password for the password property.

• Jira Service Endpoint: The URL of the Jira service to which you want to issue requests. For example, https://mycompany.atlassian.net.

• For licensed installations, you will also need the following information that was provided by Progress DataDirect:

• Control Number (IPE Key) • Serial Number

Requirements and support

Driver/Client Software Requirements:

• The driver requires a Java Virtual Machine (JVM) that is Java SE 8 or higher, including Oracle JDK, OpenJDK, and IBM SDK (Java) distributions. Supported Data Sources:

• Atlassian Jira

Note: For the latest information on supported data sources, visit the Progress DataDirect Supported Configurations page.

Downloading the driver

To download the driver for Jira:

1. Visit the Progress DataDirect Connectors Download page. 2. Select Atlassian Jira from the list of data sources. 3. Select JDBC for the interface. 4. Select your OS when prompted for your OS and architecture. 5. Fill in the registration form with your contact information. 6. Review the End User License Agreement. If you agree, select the corresponding box; then, click Download.

The installer program has been downloaded. See "Installing the JDBC driver" for detailed instructions.

See also Installing the JDBC driver on page 7

6 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 Installing the JDBC driver

Installing the JDBC driver

This section provides instructions for installing your downloaded files using the GUI installer.

Note: OEM CUSTOMERS: Refer to the Progress DataDirect for JDBC Drivers Distribution Guide for information on installing, branding, unlocking, and distributing your branded drivers.

Note: Make sure that the Java Virtual Machine (JVM) is defined on your path. Java SE 8 or higher is required to use the driver.

1. Unzip the files to a temporary directory, maintaining the directory structure of the zip file. 2. From the installer directory, run the appropriate installer file to start the installer.

• Windows: PROGRESS_DATADIRECT_JDBC_INSTALL.exe • Non-Windows: PROGRESS_DATADIRECT_JDBC_INSTALL.jar

Important: The Java installer can be run on most platforms, including Windows; however, if you run the Java installer on Windows, turn off User Account Controls or select a non-system directory as the installation directory. The Windows installer allows you to install the driver in the Program Files system directory on Windows without turning off User Account Controls.

3. The Introduction window appears. Click Next. 4. The License Agreement window appears. Make sure that you read and understand the license agreement. To continue with the installation, select the I accept the terms in the License Agreement option; then, click Next. 5. The Install Directory window appears. In the Where Would You Like to Install? field, type the path, including the drive letter, of the product installation directory or click the Choose button to browse to and select an installation directory. Verify the installation directory. Click Next to continue. 6. Choose the type of installation to perform. Select one of the following options.

• Evaluation installation (will expire in 15 days). Select this option to install evaluation versions of all available drivers. Click Next to continue with the installation. Skip to Step 10 on page 8. • OEM or Licensed installation. Select this option if you have purchased a licensed version of one or multiple drivers. Click Next. If you are updating a currently installed driver, skip to Step 8 on page 8; otherwise, proceed to the next step.

7. Type the Control Number that was provided by Progress DataDirect in the Control # field, and click the Validate button. You can add multiple control numbers consecutively. A tree menu of drivers with valid licenses appears in the selection box. For example, the following image demonstrates an Apache Cassandra installation.

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 7 Chapter 1: Quick Start: Progress DataDirect for JDBC for Jira Driver

8. From the tree menu, select the drivers that you want to install. Click Next to continue. Drivers that are already installed will be listed under Drivers (Installed) and cannot be deselected. To remove installed drivers, you must uninstall the product.

9. Enter name, company, and serial number in the fields provided. Click Next to continue. a) Type your name and company name into the corresponding fields. b) Type the serial number that was provided by Progress DataDirect.

10. The Pre-Installation Summary window appears. Review the installation information. Click Previous to revise selections; or click Install to begin the installation.

11. When the installation finishes, the Install Complete window appears. Click Done to exit the installer program.

8 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 Setting the classpath

Setting the classpath

The driver must be defined on your CLASSPATH before you can connect. The CLASSPATH is the search string your Java Virtual Machine (JVM) uses to locate JDBC drivers on your computer. If the driver is not defined on your CLASSPATH, you will receive a class not found exception when trying to load the driver. Set your system CLASSPATH to include the jira.jar file as shown, where install_dir is the path to your product installation directory.

install_dir/lib/jira.jar

Windows Example CLASSPATH=.;C:\Program Files\Progress\DataDirect\JDBC_60\lib\jira.jar

UNIX Example CLASSPATH=.:/opt/Progress/DataDirect/JDBC_60/lib/jira.jar

Driver and DataSource classes

The following are the Driver and DataSource classes used by the driver: Driver class: com.ddtek.jdbc.jira.JiraDriver DataSource class: com.ddtek.jdbcx.jira.JiraDataSource

Using connection properties

You can use connection properties to customize the driver for your environment. You can use these connection properties with either the JDBC Driver Manager or a JDBC data source. For a Driver Manager connection, a property is expressed as a key value pair and takes the form property=value. For a data source connection, a property is expressed as a JDBC method and takes the form setProperty(value). For a complete list of supported properties, refer to "Connection property descriptions" in the Progress DataDirect for JDBC for Jira User's Guide. The following tables summarize the essential connection properties used to configure the driver using basic authentication. Properties that only apply to certain session types are indicated on the table.

Note: All connection property names are case-insensitive. For example, Password is the same as password. Required properties are noted as such.

Note: The data type listed for each connection property is the Java data type used for the property value in a JDBC data source.

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 9 Chapter 1: Quick Start: Progress DataDirect for JDBC for Jira Driver

Table 1: Required Connection Properties

Property Characteristic

Password Specifies the password or API token used to connect to your Jira service.

ServerName Specifies the base URL of the Jira service to which you want to issue requests. For example, https://mycompany.atlassian.net.

User Specifies the user name that is used to connect to your Jira service.

See also Connecting using the JDBC Driver Manager on page 10 Connecting using data sources on page 14

Connecting to a DataSource

Once the driver is installed and configured, you can connect from your application to your in either of the following ways.

• Using the JDBC DriverManager, by specifying the connection URL in the DriverManager.getConnection() method. • Creating a JDBC data source that can be accessed through the Java Naming Directory Interface (JNDI).

Connecting using the JDBC Driver Manager

One way to connect to a Jira service is through the JDBC DriverManager using the DriverManager.getConnection() method. As the following example shows, this method specifies a string containing a connection URL.

Connection conn = DriverManager.getConnection ("jdbc:datadirect:jira:https://mycompany.atlassian.net;User=jsmith;Password=secret;");

Passing the connection URL After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL.

Connection URL Syntax The connection URL takes the following form:

jdbc:datadirect:jira:servername;User=username;Password=password_token; [property=value[;...]];

where:

10 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 Connecting to a DataSource

servername

specifies the URL of the Jira service to which you want to issue requests. For example, http://mycompany.atlassian.net.

user

specifies the user name that is used to connect to the Jira service.

password_token

specifies the password or API token used to connect to your Jira service.

property=value

specifies connection property settings. Multiple properties are separated by a semi-colon.

Connection URL Example

Connection conn = DriverManager.getConnection ("jdbc:datadirect:jira:http://mycompany.atlassian.net;User=jsmith;Password=secret;");

Testing the connection You can also use DataDirect Test™ to establish and test a DriverManager connection. The screen shots in this section were taken on a Windows system. Take the following steps to establish a connection.

1. Navigate to the installation directory. The default location is:

• Windows systems: Program Files\Progress\DataDirect\JDBC_60\testforjdbc • UNIX and Linux systems: /opt/Progress/DataDirect/JDBC_60/testforjdbc

Note: For UNIX/Linux, if you do not have access to /opt, your home directory will be used in its place.

2. From the testforjdbc folder, run the platform-specific tool:

• testforjdbc.bat (on Windows systems) • testforjdbc.sh (on UNIX and Linux systems) The Test for JDBC Tool window appears:

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 11 Chapter 1: Quick Start: Progress DataDirect for JDBC for Jira Driver

3. Click Press Here to Continue. The main dialog appears:

4. From the menu bar, select Connection > Connect to DB. The Select A Database dialog appears:

12 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 Connecting to a DataSource

5. Select the appropriate database template from the Defined field. 6. In the Database field, specify the ServerName for your Jira service. For example:

jdbc:datadirect:jira:http://mycompany.atlassian.net

7. Enter values for the following fields.

• In the User Name field, enter your user ID used to access your Jira service. • In the Password field, enter your password or API token used to access your Jira service.

8. Click Connect.

If the connection information is entered correctly, the JDBC/Database Output window reports that a connection has been established. (If a connection is not established, the window reports an error.)

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 13 Chapter 1: Quick Start: Progress DataDirect for JDBC for Jira Driver

For more information on using DataDirect test, refer to DataDirect Test in the Progress DataDirect for JDBC Drivers Reference.

Connecting using data sources

A JDBC data source is a Java object, specifically a DataSource object, that defines connection information required for a JDBC driver to connect to the database. Each JDBC driver vendor provides their own data source implementation for this purpose. A Progress DataDirect data source is Progress DataDirect’s implementation of a DataSource object that provides the connection information needed for the driver to connect to a database. Because data sources work with the Java Naming Directory Interface (JNDI) naming service, data sources can be created and managed separately from the applications that use them. Because the connection information is defined outside of the application, the effort to reconfigure your infrastructure when a change is made is minimized. For example, if the database is moved to another , the administrator need only change the relevant properties of the DataSource object. The applications using the database do not need to change because they only refer to the name of the data source.

How Data Sources Are Implemented Data sources are implemented through the DataSource class. The DataSource class implements the following interfaces. • javax.sql.DataSource • javax.sql.ConnectionPoolDataSource (allows applications to use connection pooling) The DataSource class for the Jira driver is com.ddtek.jdbcx.jira.JiraDataSource.

Creating data sources The following example files provide details on creating and using Progress DataDirect data sources with the Java Naming Directory Interface (JNDI), where install_dir is the product installation directory.

• install_dir/Examples/JNDI/JNDI_LDAP_Example.java can be used to create a JDBC data source and save it in your LDAP directory using the JNDI Provider for LDAP. • install_dir/Examples/JNDI/JNDI_FILESYSTEM_Example.java can be used to create a JDBC data source and save it in your local file system using the File System JNDI Provider. See "Example data source" for an example data source definition for the example files. To connect using a JNDI data source, the driver needs to access a JNDI data store to persist the data source information. For a JNDI file system implementation, you must download the File System Service Provider from the Oracle Technology Network Java SE Support downloads page, unzip the files to an appropriate location, and add the fscontext.jar and providerutil.jar files to your CLASSPATH. These steps are not required for LDAP implementations because the LDAP Service Provider has been included with Java SE since Java 2 SDK, v1.3.

Example data source To configure a data source using the example files, you will need to create a data source definition. The content required to create a data source definition is divided into three sections.

14 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 Connecting to a DataSource

First, you will need to import the data source class. For example:

import com.ddtek.jdbcx.jira.JiraDataSource;

Next, you will need to set the values and define the data source. For example, the following definition contains the minimum properties required to establish connection:

Note: Setting the password using a data source is generally not recommended. The data source persists all properties, including the Password property, in clear text.

JiraDataSource mds = new JiraDataSource(); mds.setDescription("My Jira Data Source"); mds.setServerName("http://mycompany.atlassian.net"); mds.setUser("jsmith"); mds.setPassword("secret");

Finally, you will need to configure the example application to print out the data source attributes. Note that this code is specific to the driver and should only be used in the example application. For example, you would add the following section for the minimum properties required to establish a connection:

if (ds instanceof JiraDataSource) { JiraDataSource jmds = (JiraDataSource) ds; System.out.println("description=" + jmds.getDescription()); System.out.println("servername=" + jmds.getServerName()); System.out.println("user=" + jmds.getUser()); System.out.println("password=" + jmds.getPassword()); System.out.println(); }

Calling a data source in an application Applications can call a Progress DataDirect data source using a logical name to retrieve the javax.sql.DataSource object. This object loads the specified driver and can be used to establish a connection to the database. Once the data source has been registered with JNDI, it can be used by your JDBC application as shown in the following code example.

Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("EmployeeDB"); Connection con = ds.getConnection("domino", "spark");

In this example, the JNDI environment is first initialized. Next, the initial naming context is used to find the logical name of the data source (EmployeeDB). The Context.lookup() method returns a reference to a Java object, which is narrowed to a javax.sql.DataSource object. Then, the DataSource.getConnection() method is called to establish a connection.

Testing a data source connection You can use DataDirect Test™ to establish and test a data source connection. The screen shots in this section were taken on a Windows system. Take the following steps to establish a connection.

1. Navigate to the installation directory. The default location is:

• Windows systems: Program Files\Progress\DataDirect\JDBC_60\testforjdbc

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 15 Chapter 1: Quick Start: Progress DataDirect for JDBC for Jira Driver

• UNIX and Linux systems: /opt/Progress/DataDirect/JDBC_60/testforjdbc

Note: For UNIX/Linux, if you do not have access to /opt, your home directory will be used in its place.

2. From the testforjdbc folder, run the platform-specific tool:

• testforjdbc.bat (on Windows systems) • testforjdbc.sh (on UNIX and Linux systems) The Test for JDBC Tool window appears:

3. Click Press Here to Continue. The main dialog appears:

16 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 Connecting to a DataSource

4. From the menu bar, select Connection > Connect to DB via Data Source. The Select A Database dialog appears:

5. Select a datasource template from the Defined field. 6. Provide the following information: a) In the Initial Context Factory, specify the location of the initial context provider for your application. b) In the Context Provider URL, specify the location of the context provider for your application. c) In the Datasource field, specify the name of your datasource.

7. If you are using user ID/password authentication, enter your user ID and password in the corresponding fields. 8. Click Connect.

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 17 Chapter 1: Quick Start: Progress DataDirect for JDBC for Jira Driver

If the connection information is entered correctly, the JDBC/Database Output window reports that a connection has been established. If a connection is not established, the window reports an error.

Troubleshooting setup/connection issues

This section describes common setup/connection issues you may encounter while trying to establish a with the driver as well as some potential reasons for these issues. If you are experiencing a problem not described in this section, comprehensive troubleshooting resources are available in the Troubleshooting section of the Progress DataDirect for JDBC Drivers Reference.

Common setup/connection issues

You are experiencing a setup/connection issue if you are encountering an error or hang while you are trying to make a database connection with the JDBC driver or are trying to configure the JDBC driver. Some common errors that are returned by the driver if you are experiencing a setup/connection issue include: • class not found • Specified driver could not be loaded. • Data source name not found and no default driver specified. • Unable to connect to destination. • Invalid username/password; logon denied.

18 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 Additional resources

Troubleshooting the issue

Some common reasons that setup/connection issues occur are:

• The Jira service is down. • The driver jar file, jira.jar, is not defined on your CLASSPATH. If the driver is not defined on your CLASSPATH, you will receive a class not found exception when trying to load the driver. See "Setting the classpath" for details. • The JDBC driver’s connection properties are not set correctly in the connection URL or data source. See "Configuring a data source" for more information. For example, the host name or port number are not correctly configured.

Additional resources

In addition to this quick start, the following resources enable you to take full advantage of the features and support offered for your driver. • Product Documentation Library contains a comprehensive set of product documentation, including the following guides: • Progress DataDirect for JDBC Drivers Installation Guide details requirements and procedures for installing the product. • Progress DataDirect for JDBC for Jira User's Guide guides you through using and configuring the JDBC driver. • Progress DataDirect for JDBC Drivers Reference provides general reference information for JDBC drivers, including tutorials for the tools used to troubleshoot problems.

• Progress Support Knowledgebase provides answers to questions, access to technical documentation, release notes, product alerts and other support information. • Progress Community allows you to contribute, share, and network with other Progress users and employees. • Technical Support provides technical support services, including maintenance services and opening a support case.

Contacting Technical Support

Progress DataDirect offers a variety of options to meet your support needs. Please visit our Web site for more details and for contact information: https://www.progress.com/support The Progress DataDirect Web site provides the latest support information through our global service network. The SupportLink program provides access to support contact details, tools, patches, and valuable information, including a list of FAQs for each product. In addition, you can search our Knowledgebase for technical bulletins and other information. When you contact us for assistance, please provide the following information:

Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0 19 Chapter 1: Quick Start: Progress DataDirect for JDBC for Jira Driver

• Your number or the serial number that corresponds to the product for which you are seeking support, or a case number if you have been provided one for your issue. If you do not have a SupportLink contract, the SupportLink representative assisting you will connect you with our Sales team. • Your name, phone number, email address, and organization. For a first-time call, you may be asked for full information, including location. • The Progress DataDirect product and the version that you are using. • The type and version of the operating system where you have installed your product. • Any database, database version, third-party software, or other environment information required to understand the problem. • A brief description of the problem, including, but not limited to, any error messages you have received, what steps you followed prior to the initial occurrence of the problem, any trace logs capturing the issue, and so on. Depending on the complexity of the problem, you may be asked to submit an example or reproducible application so that the issue can be re-created. • A description of what you have attempted to resolve the issue. If you have researched your issue on Web search engines, our Knowledgebase, or have tested additional configurations, applications, or other vendor products, you will want to carefully note everything you have already attempted. • A simple assessment of how the severity of the issue is impacting your organization.

20 Progress DataDirect for JDBC for Jira: Quick Start: Version 6.0.0