Context interface in java

Posted on 2009-12-16
Last Modified: 2013-11-24
hi all, please explain me what is the use of Context() in java. I read javadoc but didn't understand. Please also explain use of INITIAL_CONTEXT_FACTORY  and PROVIDER_URL.
Question by:jayz_smith
    LVL 59

    Accepted Solution

    The "D" is the important part of JNDI when trying to figure out the significance of Context.  The Context in a directory service is the level at which you are in the tree.  For example ou=users,o=somedirectory or ou=users,dc=someds,dc=somedomain,dc=com are contexts within a given directory.

    The INITAL_CONTEXT_FACTORY establishes the API (vendor) of the LDAP directory.  com.sun.jndi.ldap.LdapCtxFactory for example.

    PROVIDER_URL is a string formatted according to the context factory above that specifies the LDAP server to contact and the initial directory location to open.  This may be of importance if the proxy account (user name and password used to bind to LDAP) only has visibility at a certain level in the tree.  Otherwise, you may see the PROVIDER_URL as the server name, port, root of directory.



    Expert Comment


    Author Closing Comment

    good try.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    string initialization in java 11 94
    only14 challenge 19 57
    mapBully challenge 6 53
    Core Java. What output will be and why ? 6 40
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now