• Post Reply Bookmark Topic Watch Topic
  • New Topic

@Resource doubts

 
Jonathan Elkharrat
Ranch Hand
Posts: 170
Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

what happen wehn a field is annotated with @resource?
i.e. @Resource DataSource myDS;
is the container inject a datasource mapped to "java:comp/env/pacageName.className/myDS"?
is it ths same as:
??

and when annotating the class like that @Resource(name="myName" type=javax.sql.DataSource.class)
how the container know what to add to the bean environment?

 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!