• Post Reply Bookmark Topic Watch Topic
  • New Topic

@Resource doubts  RSS feed

 
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?

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!