21 DBMS_LDAP → DBMS_LDAP provides functions and procedures to access data from LDAP servers. To use DBMS_LDAP, you … information on using DBMS_LDAP. This chapter discusses the following topics: Exception Summary Summary of Data Types Summary of DBMS_LDAP Subprograms
DBMS_LDAP Reference → DBMS_LDAP contains the functions and procedures which can be used by PL/SQL programmers to access
DBMS_LDAP Sample Code → This section contains these topics: Using DBMS_LDAP from a Database Trigger Using DBMS_LDAP for a Search
DBMS_LDAP Sample Programs → of DBMS_LDAP in a relational environment. The samples illustrate the use of the DBMS_LDAP API for the
Building Applications with DBMS_LDAP → you can use to load the DBMS_LDAP package: SQL> CONNECT / AS SYSDBA SQL> @?/rdbms/admin/catldap.sql
Summary of DBMS_LDAP Subprograms → Table 21-3 DBMS_LDAP Subprograms Function or Procedure Description init Function Initializes a
Searching by Using DBMS_LDAP → of DBMS_LDAP API provides only synchronous search capability. This implies that the caller of the … functions available for initiating searches in the DBMS_LDAP API: DBMS_LDAP.search_s() DBMS_LDAP.search_st
About the DBMS_LDAP Package → The PL/SQL API in the DBMS_LDAP package is based on the C API described in Chapter 3, \"C API for
Using DBMS_LDAP for a Search → The following example illustrates using the DBMS_LDAP API to perform an LDAP search in a PL/SQL … '; ldap_base:= 'o=acme,dc=com'; -- end of customizable settings DBMS_OUTPUT.PUT('DBMS_LDAP Search … ); -- Choosing exceptions to be raised by DBMS_LDAP library. DBMS_LDAP.USE_EXCEPTION:= TRUE; my_session
Using DBMS_LDAP from a Database Trigger → The DBMS_LDAP API can be invoked from database triggers to synchronize any changes to a database … reflected/replicated to the LDAP directory using the DBMS_LDAP package. This script assumes the … ,' ') || ': ' || ldap_port); -- Choosing exceptions to be raised by DBMS_LDAP library
Initializing the Session by Using DBMS_LDAP → with the API. The DBMS_LDAP API uses the LDAP session handles to maintain state about open
Enabling Session Termination by Using DBMS_LDAP → Once an LDAP session handle is obtained and all of the desired LDAP-related work is complete, the LDAP session must be destroyed. This is accomplished through a call to DBMS_LDAP.unbind_s(). The function unbind_s has the following syntax: FUNCTION unbind_s (ld IN SESSION ) RETURN PLS_INTEGER; A successful call to unbind_s closes the TCP/IP connection to the LDAP server, de-allocates all system resources
4 The DBMS_LDAP PL/SQL Package → This chapter introduces the DBMS_LDAP package, which enables PL/SQL programmers to access data from … LDAP servers. It provides examples of how to use DBMS_LDAP. This chapter contains these topics … : About the DBMS_LDAP Package Building Applications with DBMS_LDAP Dependencies and Limitations DBMS_LDAP
Enabling Authentication to a Directory Server by Using DBMS_LDAP → The functions simple_bind_s and bind_s enable applications to authenticate to the directory server by using certain credentials. The function simple_bind_s has the following syntax: FUNCTION simple_bind_s ( ld IN SESSION, dn IN VARCHAR2, passwd IN VARCHAR2) RETURN PLS_INTEGER; The function simple_bind_s requires the LDAP session handle obtained from init as the first parameter. It also requires an
Exceptions → Table 21-9 simple_bind_s Function Exceptions Exception Description invalid_session Raised if the session handle ld is invalid. mts_mode_not_supported Raised if DBMS_LDAP.init is invoked from a user session that is logged onto as an MTS service. general_error For all other errors. The error string associated with this exception explains the error in detail.
bind_s Function → This function performs complex authentication to the directory server.
Syntax → DBMS_LDAP.unbind_s ( ld IN SESSION ) RETURN PLS_INTEGER;
Usage Notes → The unbind_s function sends an unbind request to the server, closes all open connections associated with the LDAP session, and disposes of all resources associated with the session handle before returning. After a call to this function, the session handle ld is invalid and it is illegal to make any further LDAP API calls using ld. See Also: \"simple_bind_s Function\" \"bind_s Function\"
compare_s Function → This function tests whether a particular attribute in a particular entry has a particular value.
Parameters → Table 21-19 search_s Function Parameters Parameter Description ld (IN) A valid LDAP session handle. base (IN) The dn of the entry at which to start the search. scope (IN) One of SCOPE_BASE (0x00), SCOPE_ONELEVEL (0x01), or SCOPE_SUBTREE (0x02), indicating the scope of the search. filter (IN) A character string representing the search filter. The value NULL can be passed to indicate that the filter