The Generic Code Translation filter enables simple lookups in a database table based on message fields to replace or populate other message fields.

The message body is replaced with the data in the file specified in the Message File field, if one is supplied. Following the replacement, the message is parsed using the Definition File and each field in the message (listed in the Substitute Field Mappings field) has its value replaced, which is retrieved from a database, with the respective value.

One or more fields in the message (listed in the Key Field Mappings field) are referenced in order to retrieve required information from the database.

Configuration Properties

Property

Description

Maximum Concurrency

The maximum level of concurrency for this filter. A setting of 0 (zero) means unlimited. Limiting the level of concurrency limits memory usage. Refer to Maximum Concurrency for details.

Definition File

Identifies the Message Definition file that defines incoming and outgoing messages.

Message File

An optional file that is used to replace the entire message body. This file is used to replace the body of the incoming message before the values are inserted.

Database

The type of database to connect to:

  • Microsoft SQL Server - Microsoft Driver - the com.microsoft.sqlserver.jdbc.SQLServerDriver is used to enable access.
  • Microsoft SQL Server - jTDS - the net.sourceforge.jtds.jdbc.Driver is used to enable access.
  • Oracle - the oracle.jdbc.OracleDriver is used to enable access.
  • MySQL - you must download the MySQL JDBC driver (com.mysql.jdbc.Driver) and attach it to the communication point as an auxiliary file. If you want to use the MySQL Connector/J driver (com.mysql.cj.jdbc.Driver), then you must select Manual Setting.
  • Microsoft Access - the sun.jdbc.odbc.JdbcOdbcDriver is used to enable access.
  • PostgreSQL - the org.postgresql.Driver is used to enable access.
  • Manual Setting - the JDBC driver and database URL must be included in the configuration file. Refer to Database Drivers and URLs for details.

Host

The hostname/IP address of the database to connect to.

This property is available only if Database is not set to Manual Setting.

Port

The port number to connect to on the database.

Database Name

The name of the database. If Microsoft Access is selected for the database property then the name of the data source should be provided.

This property is available only if Database is not set to Manual Setting.

JDBC Driver

The name of a JDBC driver class.

Database URL

The JDBC URL to connect the database.

Username

The database user to connect as.

Password

The password for that user.

Additional Connection Properties

A list of name/value pairs of message properties to be set on the database connection.

The listed properties are not used when Database is set to Manual Setting.

Database Table

The name of the database table for which to lookup. The SQL statement to be executed has the general form:

SELECT LookupColumn_1, ..., LookupColumn_N FROM Table
WHERE KeyColumn_1 = value_1 AND ... KeyColumn_N = value_N

Key Field Mappings

An array of Field and Column Name. The message field data is extracted from the input message in order to define required conditions. All listed column names and the respective values are used in the WHERE clause of the SQL statement and appended with AND operator.

Substitute Field Mappings

An array of "Field" and "Column Name". The listed fields are inserted or replaced by return values of the respective lookup columns in the table. (First row of the result set will be used to populate the message if the SQL statement returns more than one row.)

Socket Timeout

Specifies how long, in seconds, the underlying connection should remain open before timing out. The socket timeout prevents Rhapsody from waiting indefinitely for results from a database in the event Rhapsody loses its connection to the database.

A value of zero indicates the timeout is not configured.

Published Properties

Published properties for the Generic Code Translation filter are:

  • ResultRows - indicates whether there are rows matched in the database by the SQL query used to perform the field translation:

    Value Description
    0 No results
    1 Single Result
    2 Multiple Results