-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gurkan,

On 6/16/2010 10:44 AM, Gurkan Erdogdu wrote:
> Please define some servlet and try with it, 
> 
> class TestClass extends HttpServlet{
>   
>     private @Resource(name="jdbc/TestDb") DataSource datasource;
> 
>     @PostConstruct
>     public void postConstruct(){
>           //Check datasource here
>     }
> }

While this example appears to work, I might recommend to the reader that
using a JDBC DataSource directly in a servlet should probably be
considered poor architecture. I would recommend putting your
data-fetching logic in a support class, which will be easier to test and
maintain over time.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwZYCEACgkQ9CaO5/Lv0PCi9QCeNZoqsj8I+H+1XI4tOWgzomyE
/FgAn1EqT6y+9v7Hbwcdt7n2yRo5mDCD
=GpeJ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to