01: /*
02: * Licensed under the X license (see http://www.x.org/terms.htm)
03: */
04: package org.ofbiz.minerva.pool.jdbc;
05:
06: import java.sql.*;
07:
08: /**
09: * 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: }
|