• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI name lookup  RSS feed

 
Dasun Perera
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys,
I am reading that when a datasource to be looked up in a EJB project each ejb should have reference-ref defined. My question is if this EJB project has a java file (say.. a utility class) which needs to lookup datasource, where should be the reference-ref defined. Or what is the standard way of looking up datasource in this case whcih is compatible with J2EE (so I can use the same technique whcih works with all app servers)

Appreciate expert advice from somebody..

Dasun Perera
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
resource-ref are not mandatory but are recommended. If the java utility is being used as part of a servlet then the resource-ref will go into the web.xml. If that utility is part of an EJB then it will go in ejb-jar.xml. There's this thread which talks more on such things, which you might be interested in.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!