Working with database connections from the Database Explorer view
Before you can perform any actions on a database, you need
to connect to it. A database connection in this view will have a green icon ()
beside it. When you dont have a connection to a database, its corresponding
icon will be grey ().
Working with disconnected databases
When you dont have a connection
to a database, you can still perform a number of functions on the database
connection object (though not on the database itself). Highlight the connection
object, right-click, and select one of the following options:
Delete Removes a database connection from the Database Explorer
view. (This action doesnt drop the database, just the connection from Rational
New SQL Statement - Creates a new SQL statement to run against the target
database. This action will automatically attempt a connection to the selected
database and start the New SQL Statement wizard (covered later in this series).
Refresh Updates the view in the Database Explorer after, for example,
a database was dropped or you changed the filter settings for a database
Edit Connection - Opens the New Connection wizard where you can change the
configuration settings of an existing database connection.
Work Offline - Enables you to work with the database schema offline. This
gives you the ability to get assistance for generating SQL statements,
visualizing schemas, and more, without having to have a live connection to the
database. In order to use this option, you have to enable the database
connection for offline work during a connected database session (detailed later
in this article).
Reconnect Attempts to reconnect to a database. On each attempt, you
will be prompted for a valid user ID and password:
Working with connected databases
When you have a connection to a
database, you can perform some additional functions on the database connection
object, as well as work with objects within the database itself. (Unlike
disconnected connections, you can expand a connected connection object to show
the actual database and its contents.)
Instead of the Reconnect option, of course, you have
the Disconnect option when working with a live database connection. You
can also select the Save Offline option to enable the Work Offline option
described in the Working with disconnected databases section. This option instructs
Rational DA to save a copy of the database schema for use when a database
connection is not present. The process to create an offline copy of the
database schema can take a long time depending on the size of your database. To
have this work performed in the background, click Run in Background.
After you have created an offline work environment, the next
time you select the Work Offline option for a disconnected database
connection object, you can use the objects within it from the cache, as shown
You can see in the previous figure that even though the SAMPLE database doesnt
have a live connection, this object has a sub-tree that contains the actual
database and enabled folders so that you can perform actions on its objects.
Note that this only provides you access to the schema for design purposes. For
example, you couldnt run an SQL statement from a disconnected database in offline
mode, but you could create one.
Wrapping it all up
In this article, I showed you how to add and work with
database connection objects in the Rational Data Architect Database Explorer
view. In the next two articles, I will focus on solving real business problems
with Rational DA, and show you more functions that you can perform. In the next
article, I take you on a tour of all operations you can perform against the
database objects of a connected database.
See All Articles by Columnist Paul C. Zikopoulos
About the Author
Paul C. Zikopoulos,
BA, MBA, is an award-winning writer and
speaker with the IBM
Database Competitive Technology team. He has more than ten years
of experience with DB2 and has written more than one hundred magazine articles
and currently working on his tenth book. Paul has co-authoed the books DB2 9:
New Features, Information on Demand: Introduction DB2 9 New Features, Off to
the Races with Apache Derby, DB2 Version 8: The Official Guide, DB2: The
Complete Reference, DB2 Fundamentals Certification for Dummies, DB2 for
Dummies, and A DBA's Guide to Databases on Linux. Paul is a DB2 Certified
Advanced Technical Expert (DRDA and Cluster/EEE) and a DB2 Certified Solutions
Expert (Business Intelligence and Database Administration). In his spare time,
he enjoys all sorts of sporting activities, running with his dog Chachi, and
trying to figure out the world according to Chloë his new daughter. You can
reach him at: mailto:firstname.lastname@example.org.
IBM, ClearCase, Cloudscape,
DB2, Rational, and WebSphere are trademarks or registered trademarks of
International Business Machines Corporation in the United States, other
countries, or both.
Windows is a
trademark of Microsoft Corporation in the United States,
other countries, or both.
UNIX is a
registered trademark of The Open Group in the United States and other countries.
Linux is a registered
trademark of Linus Torvalds in the United States,
other countries, or both.
product, or service names may be trademarks or service marks of others.
International Business Machines Corporation, 2007. All rights reserved.
solutions, and advice in this article are from the authors experiences and are
not intended to represent official communication from IBM or an endorsement of
any products listed within. Neither the author nor IBM is liable for any of the
contents in this article. The accuracy of the information in this article is
based on the authors knowledge at the time of writing.