Hi all,
I've started preparing for SCWCD with HFSJ one week back and I'm trying to implement these concepts while learning...
I'm confused about one thing..
Approach one: Write a
java bean which returns connection object on calling its get method. So, in every
servlet which requires DB access which call this method to get connection and after updating DB, it will close the connection.
Approach two: Write a servlet context listner and store the connection object as serlvetcontext attribute. So, the connection object will be available for the whole web-app and can be used in any servlet.
Which one of the above two is better approach? Can any one let me know with reasons.
Thanks in advance
[ September 03, 2006: Message edited by: Kishore Balla ]