View the steps to set up JCR collation to
work with your DB2® database.
JCR collation is recommended when the language locales of your users
do not natively collate correctly in the DB2 database and when
language locale correct ordering is important.
- Prerequisites
- Windows idle standby: Installing DB2
- Windows idle standby: Modifying DB2 database properties
Procedure
- Stop the WebSphere® Portal Express® server. See Starting
and stopping servers, deployment managers, and node agents for
instructions.
- Copy the following files from the WebSphere Portal Express server to a temporary
directory on the DB2 server:
PortalServer/jcr/wp.content.repository.install/lib/wp.content.repository.install.jar
wp_profile/PortalServer/jcr/config/registerCollationUDFTemplate.sql
- Set up collation on the database where the
JCR domain is located. Log in to the database machine with a user
ID that is authorized and configured to use the appropriate DB2 instance. For
example, a common user ID is db2inst1.
- Change to the directory db2home/function.
- Run the command:
db2home/java/jdk/bin/jar
-xvf temporary location/wp.content.repository.install.jar
icm/CollationUDF.class
- Change to the temporary directory where you copied the
files in a previous step.
- 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.
.
- Run the following command to connect to the JCR database: db2
connect to jcrdb user user_ID using password.
- Run the script with the following command:
db2
-tvf temporary location/registerCollationUDFTemplate.sql
- Disconnect from the JCR database.
- Restart the DB2 instance.
- Verify that the UDF is registered properly.
- Log in as the db2instanceID.
- Open a DB2 terminal
window.
- Run the following command: db2 connect to JCRDB user user_ID using password.
You must connect to the JCR database as a database runtime user with
the user ID and password for the WebSphere Portal Express JCR data source.
- Once you have connected to the JCR database you need to register
the UDF. To register the UDF you run the following command: values schema.sortkeyj('abc','en')
- Edit the icm.properties file,
located in wp_profile_root\PortalServer\jcr\lib\com\ibm\icm
directory. Add the following section to the end of the 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
- Start
the WebSphere Portal Express server. See Starting and stopping servers, deployment managers,
and node agents for instructions.