public class DbPool
extends java.lang.Object
implements java.lang.AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static interface |
DbPool.DbConsumer<R> |
static interface |
DbPool.VoidDbConsumer |
| Constructor and Description |
|---|
DbPool(java.lang.String connectionString,
java.util.Properties properties,
int maxConnections) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
PooledDb |
db() |
<T> T |
execute(DbPool.DbConsumer<T> consumer) |
void |
execute(DbPool.VoidDbConsumer consumer) |
public DbPool(java.lang.String connectionString,
java.util.Properties properties,
int maxConnections)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic PooledDb db() throws java.sql.SQLException
java.sql.SQLExceptionpublic <T> T execute(DbPool.DbConsumer<T> consumer) throws java.lang.Exception
java.lang.Exceptionpublic void execute(DbPool.VoidDbConsumer consumer) throws java.lang.Exception
java.lang.Exception