• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Applying JNDI and its concepts

 
Ranch Hand
Posts: 45
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[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]
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
One of the advantage is "Location Transperancy".
Your application does not need to know physical location of deployed object if it is bound to JNDI tree.

Regards,
Amit
 
Senthil Kumar Sekar
Ranch Hand
Posts: 45
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone respond to the other questions of mine?It will be helpful for my understanding.

Thanks.

Regards
Senthil Kumar Sekar
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Java Naming and Directory Interface API is an advanced API typically used in building complex applications such as an application server or a web server, e.g. WebSphere. Developers that create applications which are "hosted" on these applications rarely write code using JNDI API.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic