• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

JNDI name lookup

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
What's brown and sticky? ... a stick. Or a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic