Configuring access to the user mapping plug-in (Java programming language)

Set the DB2_UM_PLUGIN option to configure the federated server to use a Java™ plug-in to retrieve user mappings.

Before you begin

Before you begin

Before you configure the federated server to access the user mappings in an external repository, you must perform these tasks:
  • Develop a user mapping plug-in
  • Deploy the plug-in on the federated server
  • Update the database manager configuration:
    db2 update dbm cfg using JDK_PATH your_jdk_path
    db2 terminate
    db2stop
    db2start

About this task

The DB2_UM_PLUGIN option must contain the full path of the class, including the package name. If you develop a package, you must include the package name before the class name for example, 'package.classname'. If you use the LDAP sample plug-in, specify the value 'UserMappingRepositoryLDAP' in the DB2_UM_PLUGIN option. The sample plug-in is not developed as a package.

To configure the federated server to access the external repository:

Procedure

Choose how you want to implement the user mapping plug-in:
Method SQL statement
Specify the user mapping plug-in when you create a wrapper
CREATE WRAPPER wrapper-name
  OPTIONS (
    DB2_UM_PLUGIN 'UserMappingRepositoryLDAP'
  );
Alter an existing wrapper to specify the user mapping plug-in
ALTER WRAPPER wrapper-name (
  ADD DB2_UM_PLUGIN 'UserMappingRepositoryLDAP'
  );
Specify the user mapping plug-in when you create a server definition
CREATE SERVER server_name 
  TYPE date_source_type
  VERSION version_number
  WRAPPER wrapper-name OPTIONS (
    DB2_UM_PLUGIN 'UserMappingRepositoryLDAP'
  );
Alter an existing server definition to specify the user mapping plug-in
ALTER SERVER server_name
  OPTIONS (
    ADD DB2_UM_PLUGIN 'UserMappingRepositoryLDAP'
  );

What to do next

After you set the DB2_UM_PLUGIN option, the federated server uses the connection information that you specify in the UserMappingRepositoryXXXX.cfg file to retrieve user mappings from the external repository. XXXX is the name of the plug-in.

To alter the wrapper to use a different plug-in
ALTER WRAPPER wrapper-name (
  SET DB2_UM_PLUGIN 'com.package_name.um.UserMappingRepositoryXXXX'
  );
To alter a server definition to use a different plug-in
ALTER SERVER server_name 
  OPTIONS (
     SET DB2_UM_PLUGIN 'UserMappingRepositoryXXXX'
     );