...
DataSource references in your ejb should get automatically mapped to the Resource you declare. The shortest and easiest rule is that if your reference name matches a Resource in your openejb.xml, that's the one you get. Essentially, the rules for mapping are as follows.
- Injected Name Attribute Match - variable @Resource with a name attribute matching the resource name gets that resource injected
- Injected Name Attribute Match - @Resource with a variable name attribute matching the resource name gets that resource injected
- No Match - nothing matches a resource name, so the first resource available gets injected
...