Rational Developer for System z


< Previous | Next >

Creating a connection to the DB2 SAMPLE database

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®:

  1. In the Data Source Explorer view, right-click the Database Connections folder and select New. The New Connection wizard opens.
  2. Unmark the Use default naming convention check box.
  3. In the Connection Name field, type SAMPLE4tutorial.
  4. Under the Select a Database Manager Option panel, select DB2 for Linux, UNIX, and Windows.
  5. 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.
  6. 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.
  7. 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.
  8. Expand schemaname and the Tables folder under it.
  9. Find the EMPLOYEE table and select it. You can browse the properties for this table in the Properties view.
< Previous | Next >

Feedback