public interface ConnectionPool extends Db
Connections. Pools implement Db so
queries can be issued directly to the pool if using the same connection
is not required.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the pool.
|
void |
getConnection(java.util.function.Consumer<Connection> handler,
java.util.function.Consumer<java.lang.Throwable> onError)
Executes a
Consumer callback when a connection is
available. |
void |
release(Connection connection)
Releases a connection back to the pool.
|
query, querybeginvoid getConnection(java.util.function.Consumer<Connection> handler, java.util.function.Consumer<java.lang.Throwable> onError)
Consumer callback when a connection is
available. Connection passed to callback must be freed with
release(Connection)handler - Called when a connection is acquiredonError - Called on exception thrownvoid release(Connection connection)
connection - Connection fetched with getConnectionvoid close()
close in interface java.lang.AutoCloseableCopyright © 2014. All Rights Reserved.