Skip to main content

skip to main content

developerWorks  >  Information Management  >

Get started using IBM Data Studio Developer with Informix Dynamic Server

Create, test, and deploy IDS applications

developerWorks
Go to the previous pagePage 3 of 10 Go to the next page

Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
1831 KB (44 pages)

Get Adobe® Reader®

Discuss

Sample code


My developerWorks needs you!

Connect to your technical community


Rate this tutorial

Help us improve this content


Getting started with Data Studio

Launch Data Studio

Go to Start > All programs > IBM Data Studio > IBM Data Studio Developer, and click Data Studio Developer. This prompts you to pick a location for your workspace directory. Enter an appropriate location.

Connect to IDS

  1. Launch the Data Studio integrated development environment (IDE) by using the short-cut mentioned above.
  2. The IDE should be launched with the default "Data" perspective. If not, you will have to open the perspective by navigating to Window > Open Perspective > Other > Data.

    See the upper right corner where the "Data" perspective is shown in the following figure.

    Figure 1. Location of "Data" perspective
    Location of Data perspective


    (Click here to see a larger image of Figure 1.)
  3. In the bottom left-hand corner of the above figure, you should see the Data Source Explorer view. If not, the view can be enabled by navigating to Window > Show View > Data Source Explorer.

    (Note: Starting with the Data Studio Developer 2.1 release, this view is now called Data Source Explorer. For previous releases, this was called Database Explorer).
  4. Right-click on Connections to add a new connection.


    Figure 2. Creating a new connection
    Creating a new connection

  5. Set the connection parameters. Note that there are two drivers that can be used for IDS:

    • The common IBM Data Server Driver for JDBC and SQLJ that works with DB2 and IDS (in order to use this, the Informix server has to be setup to use a DRDA port)
    • the Informix JDBC driver (for Informix only, using the SQLI protocol)

    The example here uses the common IBM Data Server Driver for JDBC and SQLJ so that you can use some key features such as heterogeneous batch. For the common driver, you just need to provide the database or host for a logged database and port information, and pick the appropriate jar file. For the IDS JDBC driver, the parameters are the database name, host name, port or service name, and server name (INFORMIXSERVER).



    Figure 3. Setting up connection attributes
    Setting up connection attributes


    (Click here to see a larger image of Figure 3.)
  6. Click Finish to create the new connection.


Back to top


Explore your database

Now that a connection has been added, you can navigate through your connection in the Data Source Explorer and look at your database objects by navigating through GS_DB > Schemas > schema_name > Tables.

Use the inventory_levels table in this example. The table is located in the gosales schema.

  • To look at the sample data, right-click on inventory_levels > Data > Sample Contents. The contents are shown in the bottom, right-hand corner of the screen.
  • To look at the sample DDL, right-click on the inventory_levels > Generate DDL and use defaults for the other steps.
  • To alter the table, right-click on the table, and click on Alter. This opens up the Data Object Editor, where you can add new columns, preview the SQL, and run it from the IDE.

    Figure 4. Data Object editor
    Data Object editor

  • To see a data diagram, right-click on inventory_levels > Add to Overview Diagram, and check the box next to the product table, which is under the gosales schema, and select Infer implicit relationships. The relationship will be shown between the two tables in a generated diagram (see Figures 5 and 6):

    Figure 5. Overview diagram selection
    Overview diagram selection



    Figure 6. Overview diagram
    Overview diagram



Back to top


Creating a new table

Tip for writing stored procedures

The default statement terminator in the SQL editor is a semicolon (;). In other words, each line in a stored procedure that ends in a semicolon is treated as a single SQL statement. To change this behavior, you can change the default statement terminator by selecting the top menu bar option Window > Preferences > SQL Development > SQL and XQuery Editor.

You can also explore your other database objects using the Data Object Editor, such as views and procedures, and you can create new objects on the server using this mechanism.

Right-click Tables > Create > Table in Data Source Explorer to launch a wizard, and you can use the default steps. In the table creation, Preview DDL shows the generated DDL, then you can run the DDL from within the workbench.

Figure 7 shows the table created using Data Object Editor through generated DDL. Notice the generated DDL in the Preview screen.


Figure 7. New table
New table


Back to top



Go to the previous pagePage 3 of 10 Go to the next page