code: public boolean exists(String nodeDN)
  
     throws NamingException
  
     {
  
        try
  
        {
  
           ctx.search(nodeDN, "(objectclass=*)", existanceConstraints);
  
           return true;
  
        }
  
        catch (NameNotFoundException e)
  
        {
  
           return false;
  
        }
  
        catch (NullPointerException e)
  
        {
  
           if (ctx != null
           && ctx.getEnvironment().get("java.naming.factory.initial").toString()
           .indexOf("dsml") > 0)
  
              return false;
  
           else
  
              throw e;
  
        }
  
     }
docs: ---------------------------------------------------