FileDocCategorySizeDatePackage
MyConnectionManager.javaAPI DocExample533Thu Apr 05 20:42:10 BST 2001None

MyConnectionManager

public class MyConnectionManager extends Object implements ServletContextListener

Fields Summary
Constructors Summary
Methods Summary
public voidcontextDestroyed(javax.servlet.ServletContextEvent e)

    Connection con =
       (Connection) e.getServletContext().getAttribute("con");
    try { con.close(); } 
    catch (SQLException ignored) { } // close connection
  
public voidcontextInitialized(javax.servlet.ServletContextEvent e)

    Connection con =     // create connection
      e.getServletContext().setAttribute("con", con);