DB2 Version 9.7 for Linux, UNIX, and Windows

db2LdapCatalogDatabase API - Register the database on the LDAP server

Catalogs a database entry in LDAP (Lightweight Directory Access Protocol).

Authorization

None

Required connection

None

API include file

db2ApiDf.h

API and data structure syntax

SQL_API_RC SQL_API_FN
  db2LdapCatalogDatabase (
   db2Uint32 versionNumber,
   void * pParmStruct,
   struct sqlca * pSqlca);

typedef SQL_STRUCTURE db2LdapCatalogDatabaseStruct
{
   char *piAlias;
   char *piDatabaseName;
   char *piComment;
   char *piNodeName;
   char *piGWNodeName;
   char *piParameters;
   char *piARLibrary;
   unsigned short                      iAuthentication;
   char *piDCEPrincipalName;
   char *piBindDN;
   char *piPassword;
} db2LdapCatalogDatabaseStruct;

db2LdapCatalogDatabase API parameters

versionNumber
Input. Specifies the version and release level of the structure passed in as the second parameter, pParamStruct.
pParamStruct
Input. A pointer to the db2LdapCatalogDatabaseStruct structure.
pSqlca
Output. A pointer to the sqlca structure.

db2LdapCatalogDatabaseStruct data structure parameters

piAlias
Input. Specify an alias to be used as an alternate name for the database being cataloged. If an alias is not specified, the database manager uses the database name as the alias name.
piDatabaseName
Input. Specify the name of the database to catalog. This parameter is mandatory.
piComment
Input. Describes the DB2® server. Any comment that helps to describe the server registered in the network directory can be entered. Maximum length is 30 characters. A carriage return or a line feed character is not permitted.
piNodeName
Input. Specify the node name of the database server on which the database resides. This parameter is required if the database resides on a remote database server.
piGWNodename
Input. Specify the node name of the DB2 Connect™ gateway server. If the database server node type is DCS (reserved for host database servers), and the client does not have DB2 Connect installed, the client will connect to the DB2 Connect gateway server.
piParameters
Input. Specify a parameter string that is to be passed to the application requester (AR). Authentication DCE is not supported.
piARLibrary
Input. Specify the name of the application requester (AR) library.
iAuthentication
Input. Specifying an authentication type can result in a performance benefit.
piDCEPrincipalName
Input. Specify the fully qualified DCE principal name for the target server.
piBindDN
Input. Specify the user's LDAP distinguished name (DN). The LDAP user DN must have sufficient authority to create and update the object in the LDAP directory. If the user's LDAP DN is not specified, the credentials of the current logon user will be used.
piPassword
Input. Account password.

Usage notes

A database may need to be manually registered or cataloged in LDAP if:

- The database server does not support LDAP. In this case, the administrator needs to manually register each database in LDAP to allow clients that support LDAP to access the database without having to catalog the database locally on each client machine.

- The application wants to use a different name to connect to the database. In this case, the administrator needs to catalog the database using a different alias name.

- During CREATE DATABASE IN LDAP, the database name already exists in LDAP. The database is still created on the local machine (and can be accessed by local applications), but the existing entry in LDAP will not be modified to reflect the new database. In this case, the administrator can: -- Remove the existing database entry from LDAP, and manually register the new database in LDAP. -- Register the new database in LDAP using a different alias name.