01: package org.geotools.data.jdbc;
02:
03: import java.sql.Connection;
04: import java.sql.SQLException;
05:
06: /**
07: * This is an interface, it has the same method signature as the origional ConnectionPool.
08: * It can be used in the constructor of JDBCDataStore (instead of ConnectionPool), allowing
09: * us to create either ConnectionPool (the origional) or DataSourceAccess (the replacement
10: * that wraps up a normal java.sql.DataSource.
11: *
12: * @author Jody Garnett
13: */
14: public interface ConnectionManager {
15: /**
16: * Borrow a connection, please close after use so we can recycle it.
17: * @return
18: * @throws SQLException
19: */
20: Connection getConnection() throws SQLException;
21:
22: /**
23: * Clean up everything we can; all outstanding Connections would be rendered
24: * unfunctional.
25: */
26: void close();
27:
28: /**
29: * Check if this ConnectionAccess is already closed.
30: * @return
31: */
32: boolean isClosed();
33: }
|