File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes DataSource JNDI name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "DataSource JNDI name" Watch "DataSource JNDI name" New topic

DataSource JNDI name

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

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:/ ?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

A resource-ref entry needs to be made in the ejb-jar.xml and the corresponding jboss.xml. Something like this:



The datasource will then be available to that EJB at java:comp/env/someName/someOtherName.

[My Blog] [JavaRanch Journal]
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Ah - of course! Thanks Jaikiran.
I agree. Here's the link:
subject: DataSource JNDI name
It's not a secret anymore!