Package com.avoka.core.sql
Class PreparedStatementExecutor
- java.lang.Object
-
- com.avoka.core.sql.PreparedStatementExecutor
-
public class PreparedStatementExecutor extends Object
Provide a utility to execute PreparedStatements.
-
-
Constructor Summary
Constructors Constructor Description PreparedStatementExecutor()Create a PreparedStatementExecutor.PreparedStatementExecutor(Connection connection)Create a PreparedStatementExecutor which will use the given connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteQuery(String sqlStatement, ResultSetProcessor resultSetProcessor)Execute the sql statement and the result is handled by the processor.voidexecuteQuery(String sqlStatement, String[] args, ResultSetProcessor resultSetProcessor)Execute the sql statement with list of arguments and the result is handled by the processor.intexecuteUpdate(String sqlStatement, Object[] args)Execute the sql statement with list of arguments and the result is handled by the processor.
-
-
-
Constructor Detail
-
PreparedStatementExecutor
public PreparedStatementExecutor()
Create a PreparedStatementExecutor.
-
PreparedStatementExecutor
public PreparedStatementExecutor(Connection connection)
Create a PreparedStatementExecutor which will use the given connection. The provided connection will not be closed after the query has been executed.- Parameters:
connection- the database connection to use
-
-
Method Detail
-
executeQuery
public void executeQuery(String sqlStatement, ResultSetProcessor resultSetProcessor)
Execute the sql statement and the result is handled by the processor.- Parameters:
sqlStatement- sql statementresultSetProcessor- the result set processor
-
executeQuery
public void executeQuery(String sqlStatement, String[] args, ResultSetProcessor resultSetProcessor)
Execute the sql statement with list of arguments and the result is handled by the processor.- Parameters:
sqlStatement- sql statementargs- arguments for the prepared statementresultSetProcessor- the result set processor
-
-