Adding a database connection

You can add a database connection to your project in HCL DevOps Test Hub (Test Hub) to import the data from an external database and create the test assets. You can restrict the project members from using this database connection by adding it to a Classification and providing permission only to the required members.

Before you begin

You must have completed the following tasks:
  • Ensured that you are assigned a role as a Project Owner or Tester in the project. See Managing access to the server projects.
  • Created a project in your team space in Test Hub. See Adding a project.
  • Ensured that you have a valid Java Database Connectivity (JDBC) URL and credentials for the database.

Procedure

  1. Log in to Test Hub.

    The team space that contains your project is displayed.

  2. Click Active projects > My projects > project_name to open the project that contains the test assets.

    The Overview page of the project is displayed.

  3. Click Infrastructure > Database Connections.
    The Database Connections page is displayed.
  4. Click New Connection.
    The New Connection dialog is displayed.
  5. Perform the following actions in the Details tab:
    1. Enter a name for the database connection in the Name field.
    2. Select the database from the Driver list.
      The following are the supported databases:
      • Oracle
      • PostgreSQL
      • IBM DB2
    3. Enter the URL for the database in the URL field.
    4. Enter the username for the database in the Username field.
    5. Enter the password for the database in the Password field.
    6. Enter the schema name for the database in the Schema field.
    7. Add a description for the database connection in the Description field.
  6. Select the Restrict access using Classifications checkbox if you want to restrict other members of the project from using this database connection.

    Later you can grant access to the required members by adding the connection to a classification.

    Note: The option, Restrict access using Classifications is not selected. This is the default selection.
  7. Perform the following steps to add the SSL certificate for encrypting the data exchanged between Test Hub and the database.
    1. Click the SSL tab.
    2. Click Select File and browse to the location on your computer where you have the Java Keystore File.
    3. Select the file, and then click Open.
      The selected file name is displayed.
    4. Enter the password for the Java Keystore File in the Password field.
  8. Click Test to test the connection with the database.
    A message is displayed that confirms the connection with database.
  9. Click Save to save the database.

    A message is displayed that confirms database connection is added.

    You can view the following details of the database connection on the Database Connections page:

    Column header Description
    Name Displays the name of the database connection that you added.
    URL Displays the URL of the database connection that you added.
    User Displays the name of the user who added the database connection.
    Description Displays the description that you entered when you created the database connection.
    Actions lock icon displayed if the database is locked using classification or unlock icon displayed if the database is not locked using classification Click the lock icon to go to the Security page. You can grant access to the database connection by adding it to a classification.
    Note: The unlock icon is displayed to indicate that the database connection is not restricted for other members of the project, and they can use database connection to create the test assets.
    edit icon Click the edit icon to edit the database connection. See Editing a database connection.
    edit icon Click the duplicate icon to duplicate the database connection. See Duplicating a database connection.
    delete icon Click the delete icon to delete the database connection. See Deleting a database connection.

Results

You have added a database connection to your project.

What to do next

You can add the database to a classification to provide access to other members of the project, if you have restricted it when you created the database connection. See Adding a database connection to a classification.

You can create a database query using the database connection that you added to your project. See Creating a database query.