Binds a
Name to an
Object in this directory to produce a binding.
This binding can have attributes, which are specified by the attributes parameter if it is non-null. If the attributes parameter is null and obj is a DirContext with attributes, the binding will have the attributes of obj.
Note that null is not a valid value for name. Neither is the empty Name because this is reserved to refer to the context.
If name is already bound in this DirContext this method throws a NameAlreadyBoundException.
If there are mandatory attributes for this binding in this DirContext, and they are not specified, this method throws an InvalidAttributesException.
This method throws any NamingException that occurs.
@param name the name to be bound
@param obj the object to be bound
@param attributes the attributes of this binding, can be null
@throws NamingException If any occurs.