Testing the user mapping plug-in (Java programming language)
To test the Java™ plug-in outside of the federated server, develop an application that connects to and retrieves user mappings from the external repository.
About this task
You can develop a simple program that calls the lookupUM()
method
that your UserMappingRepositoryXXXX class inherited from
the UserMappingRepository class to connect to the external repository and
retrieve user mappings. You can view the UserMappingLookupLDAP.java file that
is located in the sqllib/samples/federated/umplugin/ldap/ directory.
In the commands below, if the full path contains spaces, then you must enclose the full path in quotation marks, for example "C:\program files\sqllib\java\db2umplugin.jar". %DB2PATH% is the directory where Db2® is installed, for example, C:\ProgramFiles\IBM\sqllib. inst_home is the instance home directory.
- remoteServerName - Remote server name for the data source
- iiAuthid - Local user ID that is associated with the user mapping
- iiInstance - Instance name of the federated server
- iiDatabase - Database name on the federated server
To test the user mapping plug-in:
java -classpath "%DB2PATH%\java\db2umplugin.jar; ^
.\UserMappingRepositoryXXXX.jar;%CLASSPATH%" ^
UserMappingLookupXXXX -server remoteServerName ^
-authid iiAuthid ^
-instance iiInstance -database iiDatabase
java -classpath inst_home/sqllib/java/db2umplugin.jar: ^
./UserMappingRepositoryXXXX.jar:$CLASSPATH \
UserMappingLookupXXXX -server remoteServerName \
-authid iiAuthid \
-instance iiInstance -database iiDatabase