This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DataSource JNDI name

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone know how you configure a DataSource so it can be looked up from an EJB in java:comp/env/ rather than directly from java:/ ?
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A resource-ref entry needs to be made in the ejb-jar.xml and the corresponding jboss.xml. Something like this:

ejb-jar.xml:



jboss.xml:



The datasource will then be available to that EJB at java:comp/env/someName/someOtherName.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah - of course! Thanks Jaikiran.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic