Introduction to Data Studio

This tutorial shows how to use IBM® Data Studio to learn about the Java™ and Data perspectives. You can learn how to connect to a database and sample the contents of tables in the database.

To start Data Studio, complete the following steps:
  1. Double-click the IBM Data Studio icon on the desktop. You can also start Data Studio by clicking Computer > More Applications > IBM Software Development > Platform > IBM Data Studio.
  2. In the Workspace Launcher window, enter one of the following commands:
    • If you are logged in as user developer, enter:
      /home/developer/pureQueryLabs
    • If you are logged in as user informix, enter:
      /home/informix/pureQueryLabs
  3. Click OK to launch Data Studio. The working directory is automatically created.
  4. Click the Workbench icon at the top of the screen.

Working with perspectives

A perspective is a group of views and editors. One or more perspectives can exist in a single Workbench window. Within a window, each perspective might have a different set of views, but all perspectives share a set of editors.

By default, Data Studio is opened in the Data Perspective. The Java perspective is an initial set of views in which the pureQuery® code is saved. A Java perspective combines views that you would normally use to edit Java programs. For example, the view that is called Package Explorer is where the pureQuery projects are stored. For this tutorial, the default Java Common Client driver is used. To set Data Studio to the Java Perspective:
  1. Select Window > Open Perspective > Java.
  2. Add the Data Source Explorer View to this perspective by selecting: Window > Show View > Other.
  3. Expand the Data Management folder and select Data Source Explorer.
  4. Click OK.
Within a perspective, you can drag the various views and place them where they are most useful.

Connecting to a database and exploring tables

This section shows how to use Data Studio to connect to an HCL Informix® database called stores. Access the contents of the customer table, and view other information about the stores database.

Connect to the stores database by using the Data Source Explorer to create a connection to the database.
  1. Return to the Java perspective by clicking Java in the upper right corner of the Data Studio window.
  2. In the Data Source Explorer window, right-click the Connections folder and select New.
  3. In the Select a database manager window, select Informix.
  4. In the Drivers section, select Informix 11.5 - Informix JDBC Driver Default.
  5. In the Properties window, change the values for Database, Host, Port number, Server, User name, and Password as shown.
    • Database: stores
    • Host: informixva
    • Port number: 9088
    • Server: demo_on
    • User name: informix
    • Password: informix
  6. Click Test Connection. If the connection is successful, click OK; otherwise, go back and check the values that you entered.
  7. Click Finish to establish the connection to the stores database.
You can now use Data Studio to explore the stores database objects.
  1. Return to the Data perspective by clicking the Data button in the upper-right portion of the Data Studio window. Click the Workbench icon (if necessary).
  2. In the Data Source Explorer window, expand the Database Connections tab and navigate to the customer table by selecting: Database Connections > stores > stores > Schemas > Informix > Tables.
  3. Right click the customer table and select Data > Sample Contents. The contents of the customer table are displayed in the Data Output view. Adjust the size of the view as necessary to view more or less of the data.

Data Studio has many powerful database object capabilities. For example, you can view the column statistics for a column in a table, and display the number of occurrences of each data value. Table statistics information is stored in the system catalog. For example, to view sample contents of the city table, complete the following steps:

  1. Right click City, then select Data > Sample Contents. The city column statistics are view by clicking the Result1 tab.
You can also view stored procedure code.
  1. Expand the Stored Procedures twistie.
  2. Double-click the cdrcmdproc stored procedure.
  3. On the Properties tab, click the Source option to view the stored procedure code.

DDL Creation from the Data Source Explorer view

This section shows how to create DDL.
  1. Return to the Data Source Explorer view in the Data perspective.
  2. Navigate to the customer table.
  3. Right click customer then select Generate DDL
  4. Click Next then click Next again.

    You can now see the schema for the customer table. You can modify the DDL in this window. You can modify the DDL, run it, save it, and so on.

  5. Click Cancel to close the Generate DDL window.

Working with value distributions

Now you will display value distributions in the orders table.
  1. Return to the Data Source Explorer view in the Data perspective
  2. Navigate to the orders table.
  3. Right click orders, then select Value Distributions > Multivariate.

Find the orders tab where each column of the table is displayed. This tabbed window is split horizontally; the top part of the window displays the columns and the bottom part displays the column value statistics in graphical form. View the distribution graph for each column by highlighting it.

Creating tables

This section shows how to create a table.
  1. Return to the Data Source Explorer view in the Data perspective.
  2. Right click Tables, then select Create > Table.
  3. Select the Table1 tab.
  4. Enter a table name and label.
  5. Click the Columns tab.
  6. Add or delete columns by using the Add or Delete icons.
  7. Click the Preview DDL button and inspect the DDL that is used to create the table.
  8. Click the Run DDL to run the DDL and create the table.
Feel free to continue exploring the stores database. However, do not change or drop existing tables, data, or both tables and data, as they are required for subsequent exercises.

Closing the database connection

To close the connection to the database, right click stores then select Disconnect.

You can also delete the tabbed windows (views) that you created during this exercise, but do not delete the Data Source Explorer view. Also, do not delete the Data Perspective or the Java Perspective.


Copyright© 2018 HCL Technologies Limited