aspose file tools
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

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

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: 10379

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