Win a copy of The Java Performance Companion this week in the Performance 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: 10447
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