Chapter 4. Databases

Create a database connection

Database Explorer view

In the Database Explorer view, you can connect to existing databases and view their designs and objects.

Database Explorer view

You can browse database designs and import them to the Data Definition view, where you can extend or modify the designs. You can also run stored procedures and user-defined functions and view the results in the DB Output view.

Using the Database Explorer view, you can:

  • Create a database connection

    Create a database connection

  • Define connection filters

  • Connect to existing databases and view their designs

  • Reconnect to a database if your database connection was disconnected

  • Disconnect from a database connection if you are connected

  • Import database designs to another folder in the Data Definition view, where you can extend or modify the designs

    Import database designs

  • Refresh the database objects that are defined for a database connection

  • Delete a database connection

  • Drag and drop database objects to the Data Definition view

For tables and schemas, you can use the Database Explorer view to generate an SQL DDL statement.

For tables, you can use the Database Explorer view to run the sample contents and generate an XML schema.

Connecting to a database by using a wizard

You can browse existing data objects by connecting to a database in the Database Explorer view. After you connect to the database, you can import the database design into a project. You can also connect to a database from the Database Connection page that is embedded in other wizards in the workbench.

This topic describes how to create a database connection by using the New Database Connection wizard that is launched from the Database Explorer view.

To connect to a database by using a wizard:

  1. Switch to the Data perspective.

  2. Right-click in the Database Explorer view, and select New Connection from the pop-up menu.

  3. On the first page of the New Database Connection wizard, select one of the following options:

    New Database Connection wizard

    • If you are connecting to a DB2 database that has a database alias, select Choose a DB2 alias and click Next.

      New Database Connection wizard. Choose a DB2 alias

    • If you are not connecting to a DB2 database that has a database alias, select Choose a database manager and JDBC driver and click Next. On the page that opens, select a database manager, a JDBC driver, and specify other connection details.

      New Database Connection wizard. Choose a database manager and JDBC driver

  4. Optional: On the Limit the objects retrieved from the database page, specify filtering options. For best performance, you should use filters when you are connecting to a large database.

    New Database Connection wizard. Limit the objects retrieved from the database

  5. Complete all other wizard steps and click Finish.

The connection is displayed in the Database Explorer view.

Professional hosting     Belorussian informational portal         Free SCBCD 1.3 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     Free IBM Certified Associate Developer Study Guide     Free SCJP 5.0 (Tiger) Study Guide     Free Mock Exam Engine     Free SCWCD 1.4 Study Guide     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide