This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 9930

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
Similar Threads
JAVA with AS/400
Reg : How get the DatasourceName?
get datasource outside action class
COnnection from DriverManager and DataSource
is a method in a class part of a transaction?