• Post Reply Bookmark Topic Watch Topic
  • New Topic

question about JNDI  RSS feed

 
liang sun
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
questuin about JDNI
Properties p=new new Properties();
p.put=......
Context c=new INitialContext(p)

My question is when need p and when don't need p. thanks
ps: who can provide material about it in internet?
 
shai koren
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
liang
you can initialize your context with Properties supplyed in the parameter and / or without. The context in initialization will look for your Resource Files ( either proveider resource files e.g jndiprovider.properties or application resource file e.g. jndi.properties) that you may have somewhere in you App-Server directory.
In addition, if the file %root%/lib/jndi.properties exists and is readable, JNDI treats it as an additional application resource file. All of the properties contained in these files are placed into the environment of the initial context. This environment is then inherited by other contexts.
you could also supply some details when you start your server with the right parameters.

have a look at http://java.sun.com/products/jndi/tutorial/TOC.html
Shai
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!