Tutorial: Create a connection in DSX to a table in the Integrated Analytics System BLUDB database

This tutorial shows how to create a connection in IBM Data Science Experience (DSX) Local to a table in the BLUDB database in IBM Integrated Analytics System (IAS), and how to use the table in a Jupyter notebook in DSX.

This tutorial shows you how to carry out the following tasks:

  • Locate connection information for tables in IAS
  • Locate the table in IAS
  • Create a connection data asset in DSX for the table
  • Use the connection data asset in a Jupyter notebook

Time required

5 minutes

Scenario

You are a data scientist who would like to perform analytics in DSX on data residing in the IAS database.

Difficulty

Beginner

Audience

Data scientists or anyone interested in working with data in DSX.

Prerequisites

You will need to have a user account on Integrated Analytics System and on the DSX Local instance running on IAS. If you don't have a user account on IAS, contact your Integrated Analytics System system administrator to create one for you. You also need an existing DSX project.

Locate connection information for tables in Integrated Analytics System

Procedure

  1. Log in to the IAS console.
  2. Click on the web console menu in the upper-left corner and then click the CONNECT menu item. Click the Connection Information sub-menu item.
    The Connection Information page opens.
  3. On the Connection Information page, locate the Connection configuration resources panel and fill the Without SSL radio button.
  4. Note the values for the following fields:
    • Host name
    • Port number
    • Database name
    • User ID
    You will also need to know the password for the user ID.

Locate the table in Integrated Analytics System

Procedure

  1. Click on the web console menu in the upper-left corner and then click the EXPLORE menu item.
    Attention: IAS administrators will not see the EXPLORE menu item in the web console. Administrators should select the ADMINISTER > Tables menu item instead.
    The Explore page opens.
  2. On the Explore page, select a schema in the list on the left side, and then select a table in the list on the right.
  3. Verify that you have access privileges to the table by clicking the View Data button to display the data in the table. If you cannot display the data, select another table or ask a database administrator to grant you SELECT access to the table.
  4. Note both the schema and table names for use in DSX.
    This tutorial use the table GOSALES in the schema DB2ADMIN as an example.

Create a connection data asset in DSX for the table

Procedure

  1. Log in to DSX on IAS.
  2. In the web console menu in the upper-left corner, click My Projects.
  3. In the projects list, click the DSX project you want to work with.
  4. Click My Connections in the Find and add data panel on the right side.
    If the Find and add data panel is not displayed, click the Find and add data icon Find and add data icon at the top of the page.
  5. Click Create Connection.
    The New Connection page opens.
  6. Give the connection a name and (optionally) a description. This tutorial uses the table name GOSALES as the connection name.
  7. Click the Target service drop-down list and select IBM dashDB.
  8. Enter the database connection values that you noted earlier for Host, Port, User, Password, and Database.
    Important: Do not check the Use SSL option.
  9. Click the SQL Object Type drop-down list and select Table.
  10. Enter the table name and schema name in the corresponding entry fields.
  11. Click Create.

Results

You should now have a data asset of type Connection that displays in the Data Assets list in your DSX project.

Use the connection data asset in a Jupyter notebook

Procedure

  1. On either the project Overview page or the Analytic Assets page, click add notebooks.
  2. On the Create Notebook page, enter a name for the notebook in the Name field and then click Create Notebook.
    Tip: By default, this creates a Python notebook. You can also choose to create a Scala or R notebook.
  3. Click the Find and add data icon Find and add data icon at the top of the page to open the Find and add data panel.
  4. Click Connections.
    You should see your data connection listed.
  5. Click Create DataFrame under your table connection.
    Two new cells appear in your notebook.
  6. Run each cell consecutively.

Results

The data from the table you selected is displayed.