Configuring the ID Resolver

Configuring the ID Resolver involves changing two property files: DB2ConnectionCustomizer.properties and IDResolveKeys.properties. The  DB2ConnectionCustomizer.properties file describes how the ID Resolver handles timestamps, storage, and database drivers. The IDResolveKeys.properties file specifies which columns of a primary entry should be used as lookups for tables that require the identifier of a primary row.

To configure the ID Resolver, do the following:

  1. Follow the step appropriate to your platform:
    • AIXLinuxSun Solaris Operating EnvironmentWindows Extract the DB2ConnectionCustomizer.properties file in the IdResGen.zip file, located in the following directory: 

      WC_installdir\lib\loader

      Rename the extracted file and place it in a directory that is in the classpath.

      Important: Do not remove or modify the existing DB2ConnectionCustomizer.properties file.

    • iSeries Copy the ISeries_RESWCSID_Customizer.properties file from the following directory:

      /QIBM/ProdData/Commerce55/properties
      to a directory that is in the classpath , rename the new file but keep the .properties extension. Make the necessary changes to this new file.

      Important: Do not remove or modify the original ISeries_RESWCSID_Customizer.properties file.

  2. Change how the ID Resolver handles database drivers

    The following lines in the ID Resolver customizer property file specify the default values for database drivers:

    DBVendorName = DB2
    DBDriverName = COM.ibm.db2.jdbc.app.DB2Driver
    DBURL = jdbc:db2:
    

    where:

    DBVendorName
    The database type. The options are DB2 Universal Database for iSeries (DB2/iSeries), DB2 for other operating systems (DB2), and the Oracle database (oracle).
    DBDriverName
    The JDBC driver name. The options are DB2 Universal Database for iSeries (com.ibm.db2.jdbc.app.DB2Driver), DB2 for other operating systems (COM.ibm.db2.jdbc.app.DB2Driver), and the Oracle database (oracle.jdbc.driver.OracleDriver).
    DBURL
    The URL to access the database. The options are DB2 Universal Database for iSeries (jdbc:db2://), DB2 for other operating systems (jdbc:db2:), and the Oracle database (jdbc:oracle:oci8:@).
  3. Change timestamp masks
    1. Add or change timestamp masks.

      The following default input-timestamp masks are provided:

        InputTimeStampFormat.1 = yyyy-DD hh:mm:ss.SSSSSS
        InputTimeStampFormat.2 = yyyy-MM-dd hh:mm:ss.SSSSSS
        InputTimeStampFormat.3 = yyyy-DD-hh.mm.ss.SSSSSS
        InputTimeStampFormat.4 = yyyy-MM-dd-HH.mm.ss.SSSSSS
        InputTimeStampFormat.5 = yyyy-MM-dd-hh.mm.ss.SSSSSS
        InputTimeStampFormat.6 = yyyy-MM-dd HH:mm:ss.SSSSSS
        InputTimeStampFormat.7 = yyyy-DD HH:mm:ss.SSSSSS
      

      Use the next number, for example, the next input-timestamp mask would be InputTimeStampFormat.8.

    2. Specify the output timestamp format, microsecond mask, and database-specific format by modifying the values of the following attributes:
      TargetTimeStampFormat
      For example, yyyy-MM-dd HH:mm:ss.SSSSSS
      MicroSecondMask
      For example, SSSSSS
      DatabaseSpecificFormat
      For example, YYYY-MM-DD HH24:MI:SS
    3. Change how the ID Resolver handles storage
      1. Specify how the ID Resolver handles persistent storage, by setting a value for PersistentStorageType:
        0
        the ID Resolver operates in the "normal" manner (where the symbol hashmaps exist in memory).
        1
        JDBM is used to persist the symbols and keys.
      2. Specify the number of records stored in memory, by setting a value for MemoryStorageSize:
        1
        indicates that only one record is kept in memory.
        -1
        All records are kept in memory. In this case, the ID Resolver reverts to its "normal" behavior.
  4. Create a foreign relationship using the REFKEYS table

    The REFKEYS table is created to represent a foreign relationship between tables that does not already exist in the database. Generally, the database schema describes the foreign relationship by creating a foreign-key declaration that links a column of a table to another table. If the database schema does not have a foreign relationship defined and the identifiers have to be resolved as a foreign key, then do the following:

    Create a REFKEYS table as shown in the following example DDL:
      CREATE TABLE "REFKEYS" (
                   "FKTABLE_NAME"    CHAR(18)   NOT NULL ,
                   "FKCOLUMN_NAME"   CHAR(18)   NOT NULL ,
                   "TABLENAME"       CHAR(18)   NOT NULL 
      );
    

    where:

    FKTABLE_NAME
    is the foreign (or "child") table name
    FKCOLUMN_NAME
    is the foreign column name
    TABLENAME
    is the primary (or "parent") table name
  5. Create an entry in the REFKEYS table that describes the required foreign relationship.

    Change the IdResolveKeys.properties, or create a new properties file based on the IDResolveKeys.properties file. The file is located in the following directory:

    • AIXLinuxSun Solaris Operating EnvironmentWC_installdir/properties
    • iSeries/QIBM/ProdData/WebCommerce/properties
    • WindowsWC_installdir\properties

    iSeriesTo change IdResolveKeys.properties, copy it from the  directory, save it to the /instroot/xml directory, then make any necessary changes to the new file.
     

Note: The above directory is in the classpath used by the idResGen.sh script. The values that you set in this file depend on whether you need to generate identifiers, generate cascaded primary keys, or generate compound keys an example is provided for each type: