Originally posted by manoj bagul:
One way is that u can open a connection when u login to the system and put that database connection object inside the session and retrive whenever u want.
Also when u logout close the database connection.
Originally posted by sanjay yermalkar:
I suggest keeping Jsp free from any database connection. That keeps it more maintanaible and can be easily given to a page designer who doesn't understand Java!
I'll rather keep database connection task bound. Let it be in a method (in a bean), which is actually doing the task of dealing with database. I'll not keep the connection open for all the time user is logged in. What if the user is just reading Help pages? :-)
[This message has been edited by sanjay yermalkar (edited September 20, 2001).]