The workbench provides a New Connection Wizard that makes
it easy to connect and display the status of connections in both DB2® and non-DB2 databases. In this
tutorial, you will connect to the DB2 SAMPLE
database.
Before starting this step of the tutorial, you should have
created the DB2 SAMPLE database.
To create the SAMPLE database, open the IBM DB2 folder
in the start menu, expandSetup Tools, and select
the First Steps application. Once the application
has started, select the link, Create the SAMPLE Database,
from the listed tasks First Steps helps you to complete. Follow the
instructions on the following page to create the SAMPLE database.
If you have previously created a connection to the DB2 SAMPLE database, then skip to
step six. Otherwise, to create a connection to the DB2 SAMPLE database in Rational® Developer for System z®:
- In the Data Source Explorer view,
right-click the Database Connections folder
and select . The New Connection wizard opens.
- Unmark the Use default naming convention check
box.
- In the Connection Name field, type SAMPLE4tutorial.
- Under the Select a Database Manager Option panel,
select DB2 for Linux, UNIX, and Windows.
- Specify the user ID and password that you want to connect
with, and click Finish. The
new connection is displayed in the Data Source Explorer under Database
Connections.
- Ensure that you are connected to the database connection
you created. Right click on the SAMPLE4tutorial icon
in the Data Source Explorer and, select Connect.
Tip: If you get an error message saying that, "Creating
connections to SAMPLE4tutorial has encountered a problem," ensure
that DB2 is running on your
system. You can do this by right clicking on the DB2 icon in your system notification area and
selecting Start DB2.
- Expand the tree under the new connection to the Schemas folder. When you generated the SAMPLE database, user tables were created
in a schema that matched your user ID. In this tutorial, we refer
to this schema as schemaname.
- Expand schemaname and the Tables folder
under it.
- Find the EMPLOYEE table and select it. You
can browse the properties for this table in the Properties view.