Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
» Sitemap
Free Newsletters:

By submitting your information, you agree that databasejournal.com may send you databasejournal offers via email, phone and text message, as well as email offers about other products and services that databasejournal believes may be of interest to you. databasejournal will process your information in accordance with the Quinstreet Privacy Policy.

News Via RSS Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles


Posted Nov 5, 2007

DB2 9.5 and the IBM Data Studio - Part 2 - Page 2

By Paul Zikopoulos

The basics: editing, deleting, disconnecting, and refreshing connections

You can perform a number of basic operations from a live database connection so I decided to lump them all together in this one section.

The Edit Connection option

You can edit a database connection whether its object is connected or not. When you select Edit Connection, the Edit Connection window opens:

You may want to edit a database connection for several reasons, such as to use a different user account that has different privileges on the data server, or to modify a filter created on the original database connection object. I’m not going to detail all the things you can do with this option because they are very similar to those available when adding a new database connection, which were outlined in Part 1 of this series.

Tip: If you frequently work with different user IDs or focus on different schemas, I recommend that, instead of editing the database connection object, you simply create multiple connections to the same database with different credentials or schema filters. For example, in the following figure, you can see that I have multiple database connection objects that are bound to the SAMPLE database. One of the connections has a filter that applies a PAULZ-only schema filter and another object doesn’t have any filter at all yet both use the same user account to connect to the data server. A third database connection object uses a different user account (SECADM) to connect to the database:

The Delete option

The Delete option in this context only deletes the database connection object not the database itself. (I can hear the sighs of relief already.) The only other thing I’ll mention about this option is that you don’t get a confirmation dialog box when you select it (at least in the beta version) – so ensure that this is what you want to do.

The Disconnect option

As you might expect, you use this option to disconnect a database connection object from the database for which it was created. Note that the disconnection happens only on the selected database connection object. For example, if you had two database connection objects with live connections to the same database, disconnecting one object will not affect the other, as shown below:

Note: The Disconnect option’s icon can be a bit misleading because it’s the same as the disconnected server icon. The purpose of the icon is to represent the final state, but because of its color, it may appear as if it’s not an available option.

The Refresh option

As you change things in the Database Explorer view, those changes aren’t always immediately reflected in this view. Several reasons for the delay are possible: you are working in offline mode, the cache hasn’t been updated, and so on. If you ever create an object and it doesn’t show up, or connect to a database and the status still shows disconnected, select the Refresh option. (If you’ve ever worked with the Windows Explorer in Microsoft Windows then you’re already familiar with this ‘clean-up’ task; it’s the same concept here).

Add to Overview Diagram

When you are connected to a database, you can add the database object to an overview diagram. Overview diagrams automatically include all or a selected set of data objects. If you build overview diagrams using the Information Engineering (IE) or Unified Modeling Language (UML) notation, you can discover and draw implicit foreign key relationships between these objects. I find that overview diagrams help me to understand the interaction between data objects.

When you select the Add to Overview Diagram option, IBM Data Studio gives you the option to select a number of schema objects (or a subset of them) to add to the overview diagram using the Overview Diagram Selection window:

Note, however, that the contents of the Overview Diagram Selection window are entirely dependent on any filters applied to the database connection object. For example, in Part 1 of this series, I applied a schema filter to show only the PAULZ schema, which is why that is the only option returned in the previous window.

If you disable this filter by editing the database connection or changing an object-specific filter, then the results of such actions would be taken into consideration when you select the Add to Overview Diagram option, as shown below:

In the previous figure, you can see that I disabled the PAULZ-only schema filter by selecting the Disable filter option. You can change a database-level filter or any database connection information by selecting the Edit Connection option from the pop-up menu for a database object.

The following overview diagram was created in my IDE when I simply selected the PAULZ schema from my filtered database connection object:

This doesn’t look very helpful, does it? (Rest assured: it will be.) The IDE doesn’t automatically adjust or zoom into this diagram because it has the potential to be huge. To enlarge this diagram simply double-click the title bar () and it will expand to fill the entire IDE. It should now look like this:

In this example, it’s still not that helpful because there are a lot of relationships in the SAMPLE database. IBM Data Studio provides an Outline view, which you can use to navigate large diagrams:

In the previous figure, you can see the linkage between the Outline view on the right, and the corresponding magnified view in the designer palette. There is more to the Outline view, but I’ll cover all of its capabilities in a future article.

You can further customize how the storage diagram looks by using the Properties tab, or by adding meta-data shapes and notes (such as grouping a set of related tables in a polygon or adding a note to an object describing its business use). For example, in the following figure, I used the Properties tab to include column names, types, and so on:

There are lots of features associated with overview diagrams, and I’ll cover those in my next article.

DB2 Archives

Comment and Contribute


(Maximum characters: 1200). You have characters left.