This discussion is archived
2 Replies Latest reply: Jul 2, 2012 1:59 AM by gimbal2 RSS

Hashtable deprecated

810988 Newbie
Currently Being Moderated
I have been using InitialDirContext(env) for interrogating an LDAP directory. It's been working successfully.

However when I declare the Hashtable to create the env to pass over, I am advised that
Hashtable is an obsolete collection.

I tried looking for an alternative to use, but it may be my inexperience
but I haven't been able to locate it yet.

Is there a non-deprecated way to connect to an LDAP directory to
perform searches?

Thanks
  • 1. Re: Hashtable deprecated
    EJP Guru
    Currently Being Moderated
    You don't have any choice. The API is defined to use Hashtable. You have to use Hashtable.

    Hashtable is not deprecated, although it is indeed obsolete.
  • 2. Re: Hashtable deprecated
    gimbal2 Guru
    Currently Being Moderated
    m1436 wrote:
    However when I declare the Hashtable to create the env to pass over, I am advised that
    Hashtable is an obsolete collection.
    ... by some program, likely an IDE, you're using.

    Don't believe everything a piece of technology tells you; it does not know context, it cannot reason. You can, so trust your own brain first.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points