A database connection is made, and the database structures are loaded into the Rhapsody Database Configuration Editor, when you configure a database connection.

The recommended way to create the database connection is to configure the database connection in the database communication point or filter within the Rhapsody IDE and then click the Create Configuration or Edit Configuration links from the Configuration field to launch the Database Configuration Editor. The database structure is then automatically loaded when the Database Configuration Editor is launched.

Alternatively, you can manually create a database connection, by dragging the Database Connection object from the Database Components toolbox to the top of the Database Configuration Editor:

The Database Connection Editor is then displayed. Refer to Editing Database Connections for details.

Editing Database Connections

The Database Connection Editor enables you to add or maintain the database connection:

If the Store connection information directly in database configuration field is not selected, any changes made here are not reflected in the Database communication point or filter settings. Consequently it is recommended that the database connection be configured in the Rhapsody IDE first, and then the Rhapsody Database Configuration Editor is launched so it can use that connection.

Field

Description

Display Name

This is the name of the database connection that is displayed within the editor. It is an arbitrary value and is not used to actually perform the connection to the database.

Driver Class Name

This is one of the options available in the drop-down list, or the fully qualified Java class name of the database driver to use. Database drivers for SQL Server, Oracle, and PostgreSQL are provided by default. Refer to Using Custom Database Drivers for details.

JDBC URL

This is the JDBC URL used to connect to the database. Refer to Database Drivers and URLs for information on building this URL.

Username

The username that is used to connect to the database.

Password

The password that is used to connect to the database.

Schema

The database schema that is retrieved. If this is left blank, the Rhapsody Database Configuration Editor retrieves a list of schemas to choose between.

Store connection information directly in database configuration

Select this field to store the connection information within the database configuration file itself. Where possible, it is recommended that database connections are configured within the Rhapsody IDE.

Reload Database Structure

Reload the database structure from the database, and load it to the Database Configuration Editor. If no database schema has been specified, a list of database schemas is retrieved first, followed by the tables, views, and stored procedures defined within the selected schema.

If the Rhapsody Database Configuration Editor is launched from the Rhapsody IDE, it attempts to automatically load the database structure for the configured database connection at startup. Once this has been done, it is cached to allow faster subsequent startup times. However, pressing the Reload Database Structure button in the Database Connection Editor always overwrites the cache.

Refer to Database Drivers and URLs for details on finding the correct database URL.

Using Custom Database Drivers

The Database Configuration Editor has built-in database drivers for SQL Server, Oracle, and PostgreSQL. If another database driver is specified, the following error may be encountered:

Other databases may be used if a Java database driver is provided. To enable Rhapsody IDE to retrieve a database structure using a database driver, place the JAR file containing the database driver into the <Rhapsody IDE>\DatabaseStructureReader. By default, the directory is C:\Program Files\Rhapsody\Rhapsody IDE 6\Rhapsody IDE\DatabaseStructureReader. An engine restart is not required. 

Once the driver is installed, enter the full class name of the database driver into the Driver Class Name field on the Database Connection Editor window, and the database details to load the database structure.

For the Rhapsody engine to be able to use the driver, place the JAR file containing the database driver into the data\lib folder. In this case a restart of the engine is required.

Important!

Custom database drivers must be added to both the data\lib and <Rhapsody IDE>\DatabaseStructureReader directories. Refer to Custom Drivers for details.

The Database Structure

Once a database connection has been made and the database structure has been loaded, the Rhapsody Database Configuration Editor can access the tables, views, and stored procedures within that database.

You can view the database tables, views, and stored procedures in the Server Explorer, shown in the following diagram. This allows easy reference to the database, and enables you to generate SQL and stored procedure calls.

The Server Explorer is shown on the right side of the SQL Editor and the Stored Procedure Editor screens. Different components are displayed in the Server Explorer depending on the context in which it is viewed.