1

I`m newbie at jca. I read specification of jca 1.6 and there are a lot of references to jndi like this:

A component looks up a ConnectionFactory instance from the JNDI namespace ...

Or

initctx.lookup(“java:comp/env/eis/MyEIS”);

But I couldn`t find how to specify jndi name for my jca. Or what fields of ra.xml are used to register my resource adapter ConnectionFactory.

Please write a small example or ref me to some concete page or section of specification, eventually any advice are welcome.

Thanks

Solved: specifying jndi name of jca is specific to Java EE environment implementation. In GlassFish there is menu Resources->Connectors->Connector Resources.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Andrey
  • 77
  • 1
  • 11

2 Answers2

0

Try the IBM tutorial on JCA: http://www.ibm.com/developerworks/java/tutorials/j-jca/ , it contains simple hello world application and you can download the sources too.

Kris
  • 5,714
  • 2
  • 27
  • 47
0

The best way is to use the @Resource annotation or the @Inject annotation. Which one you choose is dependent on your resource:

@Remote(SomeService.class)
@Stateless
public class SomeBean implements SomeService {
 @Resource(mappedName="comp/env/eis/MyEIS")
 ResourceX resourceX;

 ...
}
Jonathan S. Fisher
  • 8,189
  • 6
  • 46
  • 84