13.11 Implementing Password Set with Embedded SQL

Initially setting a password is usually accomplished by creating a database user account. Assuming that an <add> event is generated on the Subscriber channel, the following is an example of the output generated by XSLT style sheets that implement password set as a side effect of an XDS <add> event:

<input xmlns:jdbc="urn:dirxml:jdbc">
    <add class-name="usr" jdbc:op-id="0" 
        <add-attr name="fname">
        <add-attr name="lname">
    <jdbc:statement jdbc:op-id="0">
        <jdbc:sql>CREATE USER jdoe IDENTIFIED BY {$$password}

The <add> event is logically bound to the CREATE USER DDL statement by the jdbc:op-id and jdbc:op-type attributes.

The User DDL Command Transformation style sheet in the example .xml configuration file contains sample XSLT templates that bind user account creation DDL statements to <add> events for all databases that support them.