I don't have Spring-related example, but here is one using plain servlets/JSPs. 
In my web.xml file I have:

  <resource-ref>
  |     <res-ref-name>ds/SomeDS</res-ref-name>
  |     <res-type>javax.sql.DataSource</res-type>
  |     <res-auth>Container</res-auth>
  |     <res-sharing-scope>Shareable</res-sharing-scope>
  |   </resource-ref>

and in jboss-web.xml I have:

<jboss-web>
  |   <resource-ref>
  |     <res-ref-name>ds/SomeDS</res-ref-name>
  |     <jndi-name>java:ds/SomeDS</jndi-name>
  |   </resource-ref>
  | </jboss-web>

and in my application I look up the datasource as:

InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/ds/SomeDS");


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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072119
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to