public class SqlImpl extends Object implements SqlStream
| Constructor and Description |
|---|
SqlImpl(DataSource dataSource) |
| Modifier and Type | Method and Description |
|---|---|
BatchUpdate |
batchUpdate(String sql)
Prepares a DML statement to provide it multiple batches of parameters.
|
Execute<CallableStatement> |
call(String sql)
Prepares a call and provides it the given parameters.
|
void |
close()
Closes the underlying
DataSource. |
protected boolean |
closeConnectionAfterAction() |
Execute<PreparedStatement> |
execute(String sql)
Prepares a query.
|
protected Connection |
getConnection() |
Query |
query(SqlFunction<Connection,PreparedStatement> preparer)
Manually prepares a query from a
Connection. |
<T> SqlImpl |
registerCustomBinding(Class<T> clazz,
PreparedStatementBinderByIndex<T> preparedStatementBinderByIndex) |
Transaction |
transaction()
Opens a new transaction bound to a single connection.
|
Transaction |
transaction(Transaction.IsolationLevel isolationLevel)
Opens a new transaction bound to a single connection.
|
Update |
update(SqlFunction<Connection,PreparedStatement> preparer)
Manually prepares a DML query from a
Connection. |
public SqlImpl(DataSource dataSource)
protected Connection getConnection()
protected boolean closeConnectionAfterAction()
public <T> SqlImpl registerCustomBinding(Class<T> clazz, PreparedStatementBinderByIndex<T> preparedStatementBinderByIndex)
registerCustomBinding in interface SqlStreampublic Transaction transaction()
SqlStreamtransaction in interface SqlStreampublic Transaction transaction(Transaction.IsolationLevel isolationLevel)
SqlStreamtransaction in interface SqlStreamisolationLevel - the isolation level of the underlying transactionConnection.setTransactionIsolation(int)public Query query(SqlFunction<Connection,PreparedStatement> preparer)
SqlStreamConnection.query in interface SqlStreampreparer - the code creating a PreparedStatement from a
Connectionpublic Update update(SqlFunction<Connection,PreparedStatement> preparer)
SqlStreamConnection.update in interface SqlStreampreparer - the code creating a PreparedStatement from a
Connectionpublic BatchUpdate batchUpdate(String sql)
SqlStream
Note that the query is not actually executed until you invoke a
count method from BatchUpdate.
batchUpdate in interface SqlStreamsql - the sql querypublic Execute<PreparedStatement> execute(String sql)
SqlStream
Note that this method is not executed until you call Execute.execute().
public Execute<CallableStatement> call(String sql)
SqlStream
Note that this method is not executed until you call Execute.execute().
call in interface SqlStreamsql - the sql queryConnection.prepareCall(String)public void close()
SqlStreamDataSource.Copyright © 2019. All rights reserved.