You can write an utility class kind of thing like ConnectionPool.java which has methods like public Connection getFreeConnection() and public void returnConnection(Connection c).
Make sure that you don't close the connections in your JSPs after use. Let the same utility class close the connections when it decides they are not necessary.
So that you can have  the code two aquire a DB connection in one place which will be easier when you might change the server/driver etc in future.
-----Original Message-----
From: Sumit Mishra [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 10:31 AM
To: [EMAIL PROTECTED]
Subject: Connection in JSPs?

Hi,
 
What can be the best way of taking connection in a JSP when u have to fire a query in almost every JSP? Is the useBean approach ok?? 
 
Regards,
Sumit

Reply via email to