[color=blue]
Hi,
Can anyone tell me what is the purpose of JNDI.I went through many articles.But iam not getting the purpose of JNDI.
Please correct me if iam wrong anywhere.
Below is my understanding and Questions about JNDI API
It has two services - Naming and Directory Services.
1) Naming Services are used to locate an object which is mapped with a name.So, its a named object.
Eg: A File say temp.txt will be mapped to an object and whenever an application needs the file to be read/manipulated,we look up with the name associated and do the needful.
Question - I can also do the same thing by opening the file provided it should be any place in the SERVER and the code should locate it.Correct?In JNDI, we are mapping the file (that is again available in the SERVER) and retreive it.What is the difference here?
2) Directory Services - Using this service, we can have additional attributes.Can't we achieve the same by defining below in a property file and accessing it.What is the purpose of Directory services.
cn: Qusay H. Mahmoud
mail:
[email protected]
telephoneNumber: 123-4567
Below is the code snippet that i got from Sun site
In the above code, where exactly the binding is done? Is it in new InitialContext() statement?
'obj' - Does it represents the File Object?Can i use this object for reading the file?
What exactly happens in new InitialContext() statement?
Thanks.
Regards
Senthil Kumar Sekar[/color]