Passing DataSource object from a servlet to a JavaBean

Posted by Slavko on Stack Overflow See other posts from Stack Overflow or by Slavko
Published on 2010-05-17T18:56:18Z Indexed on 2010/05/17 19:00 UTC
Read the original article Hit count: 210

Filed under:
|
|
|

I like the ease of using @Resource annotation to get a DataSource, but as far as I know, it's not possible to use it in a regular JavaBean. Would it be considered a bad practice if I pass the DataSource object from a servlet to a bean along with the other data to avoid having that lookup code in the bean?

© Stack Overflow or respective owner

Related posts about java

Related posts about servlets