DB connection between Two servlets
Hi,
I have Two servlets, servlet1,servlet2.
In servlet1, I have written Connection Pooling using java class and In the INIT method I'm writing the database connection,
My Question is, How to use the same DB connection in servlet2 ?
here is my code (some portion) :
public class abc_internal extends HttpServlet
{ private ConnectionPool pool;
Statement stmt= null;
Statement stmt1= null;
Statement stmt2= null;
ResultSet abc = null;
ResultSet Name_Header= null;
private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
public void init(ServletConfig config) throws ServletException
{
try
{
pool = new ConnectionPool("oracle.jdbc.driver.OracleDriver","jdbc:oracle:thin:@IPADDRESS:1526:DB NAME","USERNAME","PASSWORD",5);
}catch(Exception e)
{
throw new UnavailableException("Couldn't create Connection Pool.....");
}
}
PLEASE Help me...
Thanks in advance.

