title: Declare a resource-ref in EJB
body: <p>This is how they declare a resource-ref in ejb-jar.xml :  </p>
  
  <pre><code>&lt;enterprise-beans&gt;
  &lt;session&gt;
  &lt;ejb-name&gt;ResourceBean&lt;/ejb-name&gt;
  &lt;resource-ref&gt;
  &lt;res-ref-name&gt;jdbc/employee&lt;/res-ref-name&gt;
  &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
  &lt;/resource-ref&gt;
  &lt;/session&gt;
  &lt;/enterprise-beans&gt;
  </code></pre>
  
  <p>at this link: <a href="http://javahowto.blogspot.ca/2006/06/5-ways-to-get-resources-in-ejb-3.html" rel="nofollow">http://javahowto.blogspot.ca/2006/06/5-ways-to-get-resources-in-ejb-3.html</a>
  Now if I have another session bean that needs to use the same resource-ref, do I have to declare it again inside the second EJB? Or is there  a workaround?</p>