パッケージ org.nkjmlab.sorm4j
インタフェース SqlExecutor
-
- 既知のサブインタフェースのリスト:
OrmConnection,OrmTransaction,TypedOrmConnection<T>,TypedOrmTransaction<T>
public interface SqlExecutorA interface for executing SQL with parameters.- 作成者:
- nkjm
-
-
メソッドの概要
すべてのメソッド インスタンス・メソッド abstractメソッド 修飾子とタイプ メソッド 説明 voidacceptPreparedStatementHandler(ParameterizedSql sql, ConsumerHandler<PreparedStatement> handler)Accepts handler forPreparedStatementwhich has sets the given parameters.<T> TapplyPreparedStatementHandler(ParameterizedSql sql, FunctionHandler<PreparedStatement,T> handler)Applies handler forPreparedStatementwhich has sets the given parameters.<T> TexecuteQuery(ParameterizedSql sql, FunctionHandler<ResultSet,T> resultSetHandler)Executes a query and apply the given handler to the returned result set.<T> List<T>executeQuery(ParameterizedSql sql, RowMapper<T> rowMapper)Executes a query and apply the given mapper to the each row in returned result set.intexecuteUpdate(String sql, Object... parameters)Executes an update and returns the number of rows modified.intexecuteUpdate(ParameterizedSql sql)ConnectiongetJdbcConnection()GetsConnection.
-
-
-
メソッドの詳細
-
acceptPreparedStatementHandler
void acceptPreparedStatementHandler(ParameterizedSql sql, ConsumerHandler<PreparedStatement> handler)
Accepts handler forPreparedStatementwhich has sets the given parameters.- パラメータ:
sql-handler-
-
applyPreparedStatementHandler
<T> T applyPreparedStatementHandler(ParameterizedSql sql, FunctionHandler<PreparedStatement,T> handler)
Applies handler forPreparedStatementwhich has sets the given parameters.- 型パラメータ:
T-- パラメータ:
sql-handler-- 戻り値:
-
executeQuery
<T> T executeQuery(ParameterizedSql sql, FunctionHandler<ResultSet,T> resultSetHandler)
Executes a query and apply the given handler to the returned result set.This method wraps
Statement.executeQuery(String)Parameters will be set according with the correspondence defined in
SqlParametersSetter.setParameters(SormOptions, PreparedStatement, Object...)- 型パラメータ:
T-- パラメータ:
sql- SQL code to be executed.resultSetHandler-- 戻り値:
-
executeQuery
<T> List<T> executeQuery(ParameterizedSql sql, RowMapper<T> rowMapper)
Executes a query and apply the given mapper to the each row in returned result set.- 型パラメータ:
T-- パラメータ:
sql-rowMapper-- 戻り値:
-
executeUpdate
int executeUpdate(String sql, Object... parameters)
Executes an update and returns the number of rows modified.This method wraps
Statement.executeUpdate(String)Parameters will be set according with the correspondence defined in
SqlParametersSetter.setParameters(SormOptions, PreparedStatement, Object...)- パラメータ:
sql- SQL code to be executed.parameters- Parameters to be used in the PreparedStatement.
-
executeUpdate
int executeUpdate(ParameterizedSql sql)
- パラメータ:
sql-- 戻り値:
-
getJdbcConnection
Connection getJdbcConnection()
GetsConnection.- 戻り値:
-
-