public final class Database extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static Object |
NULL_BLOB
Sentinel object used to indicate in parameters of a query that rather
than calling
PreparedStatement.setObject(int, Object) with a null
we call PreparedStatement.setNull(int, int) with
Types.CLOB. |
static Object |
NULL_CLOB |
static Object |
NULL_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
static Object |
blob(byte[] bytes) |
static Object |
clob(String s) |
void |
close() |
io.reactivex.Single<Connection> |
connections() |
static Database |
from(Pool<Connection> pool) |
static Database |
from(io.reactivex.Single<Connection> connections,
io.reactivex.functions.Action onClose) |
static Database |
from(String url,
int maxPoolSize) |
<T> SelectAutomappedBuilder<T> |
select(Class<T> cls) |
SelectBuilder |
select(String sql) |
static Database |
test()
Returns a new testing apache derby in-memory database with a connection
pool of size 3.
|
static Database |
test(int maxPoolSize) |
static Object |
toSentinelIfNull(byte[] bytes) |
static Object |
toSentinelIfNull(String s) |
TransactedBuilder |
tx(Tx<?> tx) |
UpdateBuilder |
update(String sql) |
public static final Object NULL_CLOB
public static final Object NULL_NUMBER
public static final Object NULL_BLOB
PreparedStatement.setObject(int, Object) with a null
we call PreparedStatement.setNull(int, int) with
Types.CLOB. This is required by many databases for setting CLOB
and BLOB fields to null.public static Database from(@Nonnull io.reactivex.Single<Connection> connections, @Nonnull io.reactivex.functions.Action onClose)
public static Database from(@Nonnull Pool<Connection> pool)
public static Database test(int maxPoolSize)
public static Database test()
public io.reactivex.Single<Connection> connections()
public void close()
close in interface AutoCloseablepublic <T> SelectAutomappedBuilder<T> select(@Nonnull Class<T> cls)
public SelectBuilder select(@Nonnull String sql)
public UpdateBuilder update(@Nonnull String sql)
public TransactedBuilder tx(@Nonnull Tx<?> tx)
Copyright © 2016–2017. All rights reserved.