[jboss-user] [EJB 3.0] - How to inject data source in AS independent way?

japase do-not-reply at jboss.com
Mon May 11 06:12:33 EDT 2009


Hi,

Our application uses a number of data sources. In all examples we have found data source injection in an EJB is done with the @Resource annotation and the 'mappedName' attribute, e.g.:

  | @Resource(mappedName="java:jdbc/fndbas_en-US")
  | private DataSource dsEn;
  | 

But the problem is that the 'mappedName' attribute is application server specific. For example the data source from the example above in GlassFish shouldn't be prefixed with "java"; it should only be the JNDI name alone.

Is there any way to inject data sources in a way that isn't application server specific?

Thanks!


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229993#4229993

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229993



More information about the jboss-user mailing list