The following four standard JDBC configuration properties can be specified in the XML configuration file (or using the Database Configuration Editor) or you can configure the connections directly on the database communication points and filters.

When they are configured directly on the communication points or filters using one of the standard databases, the JDBC URL is generated.

Property

Description

Driver

The fully qualified name of a JDBC driver class.

URL

The JDBC URL of the database to connect to.

Username

The database user to connect as.

Password

The password for that user.

SYNTAX:

<driver>driver name</driver>
<url>database url</url>
<username>database username</username>
<password>database password</password>

or

<driver>driver name</driver>
<url>database url</url>
<username>$(database_username)</username>
<password>$(database_password)</password>

Database Drivers and URLs

To find the correct database URL, look at the list of URLs in the following tables and follow these steps:

  1. Choose the database
  2. Use the given driver name
  3. Select the URL from the listed options. Use the top entry in the listed options unless:
    • The port number is not defaulted, in which case, select the URL which specifies the port number (the default port numbers are given below).
    • The database is a SQL Server instance, in which case, select the URL which specifies the instance.

MS SQL Server (Microsoft Driver)

  • {host}: Required: the hostname or IP address of the database server.
  • {database}: Required: the name of the database.
  • {port}: Required if a non-default port is being used: the port number which the database is using.
  • {databaseName}: Required if the database is on an instance: the name of the database.
  • {domain}: Required if the user belongs to an Active Directory domain: the name of the Active Directory domain.

Property

Description

Default Port

1433

Driver

com.microsoft.sqlserver.jdbc.SQLServerDriver

URL Choices

jdbc:sqlserver://{host}/{database}
jdbc:sqlserver://{host}:{port}/{database}
jdbc:sqlserver://{host}/{database};databaseName={instance}
jdbc:sqlserver://{host}:{port}/{database};databaseName={instance}

You can connect to SQL Server using Active Directory credentials using:

jdbc:sqlserver://{host}:{port}/{database};databaseName={instance};useNTLMv2=true;domain={domain}


Examples

jdbc:sqlserver://DatabaseServer/PatientRecords
jdbc:sqlserver://DatabaseServer:5400/PatientRecords
jdbc:sqlserver://DatabaseServer/PatientRecords;databaseName=Live
jdbc:sqlserver://DatabaseServer:5400/PatientRecords;databaseName=Live

MS SQL Server (jTDS Driver)

  • {host}: Required: the hostname or IP address of the database server.
  • {database}: Required: the name of the database.
  • {port}: Required if the non-default port is being used: the port number which the database is using.
  • {instance}: Required if the database is on an instance: the name of the instance.
  • {domain}: Required if the user belongs to an Active Directory domain: the name of the Active Directory domain.

Property

Description

Default Port

1433

Driver

net.sourceforge.jtds.jdbc.Driver

URL Choices

jdbc:jtds:sqlserver://{host}/{database}
jdbc:jtds:sqlserver://{host}:{port}/{database}
jdbc:jtds:sqlserver://{host}/{database};instance={instance}
jdbc:jtds:sqlserver://{host}:{port}/{database};instance={instance}

You can connect to SQL Server using Active Directory credentials using:

jdbc:jtds:sqlserver://{host}:{port}/{database};instance={instance};useNTLMv2=true;domain={domain}

Examples

jdbc:jtds:sqlserver://DatabaseServer/PatientRecords
jdbc:jtds:sqlserver://DatabaseServer:5400/PatientRecords
jdbc:jtds:sqlserver://DatabaseServer/PatientRecords;instance=Live
jdbc:jtds:sqlserver://DatabaseServer:5400/PatientRecords;instance=Live

Currently, an MS SQL server that has SSL connections enabled will not let Rhapsody modules connect to it with the default jTDS driver. This can be remedied by adding the ssl=request parameter to the JDBC URL as follows:
jdbc:jtds:sqlserver://{host}:{port};ssl=request
jdbc:jtds:sqlserver://{host}:{port}/{database};instance={instance};
ssl=request
 
Examples:
jdbc:jtds:sqlserver://devsql:1433;ssl=request
jdbc:jtds:sqlserver://DatabaseServer:5400/PatientRecords;instance=Live;
ssl=request

Oracle

  • {host}: Required: The hostname or IP address of the database server.
  • {service name}: Required: The database service name.
  • {port}: Required if the non-default port is being used: The port number which the database is using.

Property

Description

Default Port

1521

Driver

oracle.jdbc.driver.OracleDriver

URL Choices

jdbc:oracle:thin:@{host}:{service name}
jdbc:oracle:thin:@{host}:{port}:{service name}

Examples

jdbc:oracle:thin:@DatabaseServer:longterm
jdbc:oracle:thin:@DatabaseServer:5400:longterm

PostgreSQL

  • {host}: Required: The host name or IP address of the database server.
  • {database}: Required: The database name.
  • {port}: Required if non-default port is being used: The port number which the database is using.

Property

Description

Default Port

5432

Driver

org.postgresql.Driver

URL Choices

jdbc:postgresql://{host}/{database}
jdbc:postgresql://{host}:{port}/{database}

Examples

jdbc:postgresql://DatabaseServer/PatientRecords
jdbc:postgresql://DatabaseServer:5400/PatientRecords

MySQL

Due to GPL restrictions, the MySQL driver is not included with Rhapsody. You must obtain the MySQL driver from http://www.mysql.com.

  • {host}: The hostname or IP address of the database server. If the hostname is not specified, it defaults to 127.0.0.1.
  • {database}: Required: The database name.
  • {port}: Required if the non-default port is being used: The port number which the database is using.

Property

Description

Default Port

3306

Driver

com.mysql.jdbc.Driver

URL Choices

jdbc:mysql://[\host:port],[host:port].../[database]

[]Square brackets indicate optional parameters

Examples

jdbc:mysql://DatabaseServer/PatientRecords
jdbc:mysql://DatabaseServer:5400/PatientRecords

Microsoft Access

  • {database}: Required. The data source. The data source must be a System Data Source, that is available to all users.

Driver

sun.jdbc.odbc.JdbcOdbcDriver

URL Choices

jdbc:odbc:{data source}

Examples

jdbc:odbc: Database1.accdb

Custom Drivers

  • Databases other than MS SQL server, Oracle, ODBC.
  • Alternative drivers for the databases that are bundled with Rhapsody.

Custom drivers must be placed in the data\lib directory. On Windows®, the default directory is:

  • C:\Program Files\Rhapsody\Rhapsody Engine 6\rhapsody\data\lib

Alternatively, the drivers can be attached as an auxiliary file to the communication point or filter that needs it (this is useful if deferent versions of the same driver are needed for different connections).

Important!

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