1 /* 2 * Licensed under the X license (see http://www.x.org/terms.htm) 3 */ 4 package org.ofbiz.minerva.pool.jdbc; 5 6 import java.sql.*; 7 8 /** 9 * Wrapper for database connections. Tracks open statements, last used time, 10 * and records errors. In practice, this is used both as a wrapper for 11 * connections in a pool and as a wrapper for connections handed out by an 12 * XAConnection. 13 * @see javax.sql.XAConnection 14 * 15 * @author Aaron Mulder (ammulder@alumni.princeton.edu) 16 */ 17 public interface ConnectionWrapper extends Connection { 18 19 /** 20 * Sets the time this connection (or a statement or result set derived from 21 * it) was used. 22 */ 23 public void setLastUsed(); 24 25 /** 26 * Indicates to the connection that an error occured. This is typically 27 * used by statements and result sets derived from this connection. 28 */ 29 public void setError(SQLException e); 30 31 /** 32 * Indicates that a statement derived from this connection was closed. 33 * Statements are tracked so that any open statements can be closed when 34 * the connection is closed (or reused in a pool). 35 */ 36 public void statementClosed(Statement st); 37 } 38