The moose likes EJB and Other Java EE Technologies and the fly likes question about JNDI Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "question about JNDI " Watch "question about JNDI " New topic
Author

question about JNDI

liang sun
Ranch Hand

Joined: May 12, 2001
Posts: 51
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

Joined: Nov 04, 2001
Posts: 48
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

Shai koren<br />SCJP2 <br />SCEA (well yea only part 1 so far)
 
 
subject: question about JNDI
 
Threads others viewed
I am befuffled by this behaviour!
HF-EJB - initial context in chapter 1
Java.util.Properties Not Found During loading in Servlet/JSP Erro
Adding to property files...
JavaMail Question
MyEclipse, The Clear Choice