Setting up Database Types

You must define general settings for the database platforms you plan to work with (such as SQL Server, MySQL, Oracle, DB2, etc.). These settings will be used by Power*Architect when you set up a connection to a specific database server.

Note: Remember, at this point you are configuring general settings only and are not connecting to a specific database. For more information on connecting to a database, see the section called “Setting up Database Connections” .

Adding a New Database Type

To add a new database type:

  1. Select File » User Preferences.

    Alternate method:

    • Select Connections » Database Connection Manager or Window » Database Connection Manager. On the Database Connection Manager dialog box, click JDBC Drivers.

    The User Preferences dialog box appears, with the JDBC Drivers tab open. Existing database types, including the pre-defined database types included with Power*Architect, are listed on the left.

    Note: You can modify an existing database type by clicking on it in the list.

  2. Click + below the list of database types.

  3. Enter the following information on the General Tab:

    In this field ...

    Enter the following information ...

    Name

    Name for the database type (for example, PostgreSQL or SQL Server).

    Driver Class

    Java class name of the driver. This is the driver class within the JDBC driver JAR file that will be used for database connections.

    Connection String Template

    General format of the JDBC URL for the database platform.

    Important: You are not creating a connection for a specific database - you are entering a generic connection string that applies to the database platform. Later on, when you set up a connection to a specific database, Power*Architect will use this template to create the URL to connect to the database.

    The connection string template must conform to a specific pattern that includes literals and variables.

    • Literals are entered like normal text but may not contain angle brackets (< or >), which are reserved for defining variables. As the name implies, literals appear in the URL in the same position and way they appear in the template.

    • Variables are used to for values that change often, such as the schema or database name you wish to connect to. To define a variable in the template, use the format <variable_name:default_value> (to include a default value) or <variable_name> (if you don't want to include a default value). If you use a default value. it is entered automatically when you create a database connection. You can modify the value if the database you are connecting to is configured to use a different value.

      Each variable you define is shown below the Connection String Template field. This provides you with a preview of the values you will be able to modify when creating a database connection.

    For example, the connection string template to connect to a Microsoft SQL Server database might look like this:

    jdbc:sqlserver://<Hostname>:<Port:1433>

    When you create a connection to a specific SQL Server database, Power*Architect will use this template to create the connection URL. In this example, the template will create the URL "jdbc:sqlserver://:1433", where 1433 is the default port value. Since SQL Server databases listen to port 1433 by default, it makes sense to include this value in the template. When you're creating the actual database connection, you can change the port value if the database you're connecting to is configured differently.

  4. The settings on the Kettle tab are only used when you create a Kettle job. For more information on these settings, see the section called “Using Kettle Jobs” .

  5. Click OK.

Next, you must define the location of the JDBC driver for the database type. For more information, see the section called “Defining the JDBC Driver” .

Defining the JDBC Driver

Whether you are adding a new database platform to Power*Architect or want to use one of the pre-configured platforms, the last step in setting up a database type is to locate the JAR file (or files) that contain the JDBC drivers for the database platform.

Note: Remember, at this point you are just telling Power*Architect where the drivers are. You must set up a database connection in order to connect to a specific database server (for more information, see the section called “Setting up Database Connections” ).

Unlike most applications, which need a distinct driver program to communicate with each type of database, Power*Architect uses Java-based drivers. These drivers normally come from the database vendor in the form of JAR (Java Archive) files. JAR files are an extension to the file format used by PKZip/WinZip archives.

Most database platforms provide drivers that are fully backward compatible. This means that it is best to use the newest driver available, regardless of the software version on the specific database server you intend to connect to. One exception to this is the Oracle database. It is important to match the major version number of your JDBC driver with the major version number of the Oracle database server you connect to. For example, if you are connecting to an Oracle 10g database, use the latest Oracle 10g driver. If you are connecting to an Oracle 9i database, use the Oracle 9i driver.

To define the JDBC driver for a database type:

  1. If you do not have the JDBC driver for a specific database platform, you can usually obtain one from the database vendor. If that fails, you can find a directory of databases drivers on Sun's web site . There is also a permanent thread in the Power*Architect user support forum , where you can share information with other Power*Architect users about finding and configuring drivers for a particular database platform.

  2. Decide on a permanent location to store your JDBC drivers. A good strategy is to create a JDBC folder under your Documents folder and collect all of you JDBC driver files there.

  3. Save the JDBC driver (it will usually be one or more JAR files) in the location you've chosen.

  4. If the User Preferences dialog box is not already open, select File » User Preferences.

  5. On the JDBC Drivers tab, select a database type.

  6. Click Add JAR.

  7. Locate the JAR file and click Open. If there is a valid driver class in the JAR file, a file tree will appear showing the JDBC driver classes within the JAR file.

  8. Select the driver you want to use.

  9. Click OK.