FileDocCategorySizeDatePackage
SessionConnection.javaAPI DocExample982Mon Jun 18 19:45:52 BST 2001None

SessionConnection

public class SessionConnection extends Object implements HttpSessionBindingListener

Fields Summary
Connection
connection
Constructors Summary
public SessionConnection()

    connection = null;
  
public SessionConnection(Connection connection)

    this.connection = connection;
  
Methods Summary
public java.sql.ConnectiongetConnection()

    return connection;
  
public voidsetConnection(java.sql.Connection connection)

    this.connection = connection;
  
public voidvalueBound(javax.servlet.http.HttpSessionBindingEvent event)

    if (connection != null) {
      System.out.println("Binding a valid connection");
    }
    else {
      System.out.println("Binding a null connection");
    }
  
public voidvalueUnbound(javax.servlet.http.HttpSessionBindingEvent event)

    if (connection != null) {
      System.out.println(
       "Closing the bound connection as the session expires");
      try { connection.close(); } catch (SQLException ignore) { }
    }