Example 11-13: Simple JavaBean wrappering a JDBC Connection

import java.sql.*;

public class ConnectionBean {
  Connection cn = null;
  public ConnectionBean() {
    try { cn = Examples.getConnection();  }
    catch (SQLException s) { /* Ignore */ }
  }
  public Connection getConnection() { return cn; }
  public void close() {
    try {cn.close();}
    catch (Exception e) { /* Ignore */ }
  }
}