+

Search Tips   |   Advanced Search

Portal, V6.1


 

Configure JCR collation support

This section provides information on setting up JCR collation to work with your DB2 database.

Prerequisites

Installing DB2

Create users

Creating remote databases

JCR collation is not supported on IBM DB2 Universal Database for z/OS®, IBM DB2 for i5/OS™, and Apache Derby. This means that if the JCR collation function sortkey() is invoked on one of these database platforms, the collation specified in the second argument to the function has no effect. The result of the function is the same as its first argument. The behavior is governed by the underlying database.

  1. Stop the WebSphere Portal server:

  2. Set up collation on the database where the JCR domain is located.

    1. Change to the directory db2home\function.

    2. Execute the command jar xvf portal_server_root\jcr\prereq.jcr\config\collation.jar.

    3. Change to the directory portal_server_root\jcr\prereq.jcr\config\.

    4. Open the file registerCollationUDFTemplate.sql and change all SCHEMA references to the JCR schema. For example...

      JCR.

      The value set for SCHEMA should match the value set for the jcr.DbSchema property. If running in a clustered environment, modify the following settings:

      • Change "VALUE VARCHAR(32672)," to "VALUE VARCHAR(100),"

      • Change "RETURNS VARCHAR(32672) FOR BIT DATA" to "RETURNS VARCHAR(100) FOR BIT DATA".

      .

    5. Connect to the JCR database.

    6. Execute the script by running the command db2 -tvf registerCollationUDFTemplate.sql.

    7. Disconnect from the JCR database.

    8. Restart the DB2 instance.

  3. Verify that the UDF is registered properly.

    1. From the command line, type the command db2 connect to JCRDB userid using password.

    2. Execute the command db2 values schema.sortkeyj('abc','en'), where schema is the schema under which sortkeyj was registered. If the commands complete successfully, the UDF is registered correctly

  4. Edit the icm.properties file:

        # Enable/Disable collation support for all DB2 platforms
        # Disabled by default
        jcr.query.collation.db2.enabled = true
    
        # Database specific collation mappings
        # These mappings apply map a Java locale name into a collation name
        # supported by the underlying database.
        # Example mappings for DB2 platform
    
        # English
        jcr.query.collation.en = en
      
        # Swedish
        jcr.query.collation.sv = sv
    
        jcr.query.collation.zh = zh
        jcr.query.collation.de = de
        jcr.query.collation.da = da
        jcr.query.collation.hu = hu
        jcr.query.collation.jp = jp
    

  5. Start the WebSphere Portal server: startServer.bat WebSphere_Portal

 

Parent topic

Configure WebSphere Portal to use DB2

 

Previous topic:

Creating remote databases

Next topic:

Assigning custom table spaces