com.googlecode.jpattern.orm.query
Interface ISqlExecutor

All Known Implementing Classes:
SqlExecutor

public interface ISqlExecutor

Author:
Francesco Cina 09/lug/2011

Method Summary
 ISqlBatchUpdate batchUpdate(List<String> sqls)
          Issue multiple SQL updates on a single JDBC Statement using batching.
 ISqlBatchUpdate batchUpdate(String sql, IPreparedStatementCreator psc)
          Issue multiple SQL updates on a single JDBC Statement using batching.
 ISqlBatchUpdate batchUpdate(String sql, List<Object[]> args)
          Issue multiple SQL updates on a single JDBC Statement using batching.
 ISqlExecute execute(String sql)
          Issue a single SQL execute, typically a DDL statement.
 ISqlQuery query(String sql, Object... args)
          Perform a single SQL select operation.
 ISqlUpdate update(String sql, IGeneratedKeyReader generatedKeyReader, Object... args)
          Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters.
 ISqlUpdate update(String sql, Object... args)
          Perform a single SQL update operation (such as an insert, update or delete statement).
 

Method Detail

query

ISqlQuery query(String sql,
                Object... args)
Perform a single SQL select operation.

Parameters:
sql - static SQL to execute
args - arguments to bind to the query
Returns:

execute

ISqlExecute execute(String sql)
                    throws OrmException
Issue a single SQL execute, typically a DDL statement.

Parameters:
sql - static SQL to execute
Throws:
OrmException

update

ISqlUpdate update(String sql,
                  Object... args)
                  throws OrmException
Perform a single SQL update operation (such as an insert, update or delete statement).

Parameters:
sql - static SQL to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

update

ISqlUpdate update(String sql,
                  IGeneratedKeyReader generatedKeyReader,
                  Object... args)
                  throws OrmException
Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters. Generated keys can be read using the IGeneratedKeyReader.

Parameters:
psc - object that provides SQL and any necessary parameters
generatedKeyReader - IGeneratedKeyReader to read the generated key
Returns:
Throws:
OrmException

batchUpdate

ISqlBatchUpdate batchUpdate(List<String> sqls)
                            throws OrmException
Issue multiple SQL updates on a single JDBC Statement using batching.

Parameters:
sql - defining a List of SQL statements that will be executed.
Returns:
Throws:
OrmException

batchUpdate

ISqlBatchUpdate batchUpdate(String sql,
                            List<Object[]> args)
                            throws OrmException
Issue multiple SQL updates on a single JDBC Statement using batching. The same query is executed for every Object array present in the args list which is the list of arguments to bind to the query.

Parameters:
sql - defining a List of SQL statements that will be executed.
args - defining a List of Object arrays to bind to the query.
Returns:
Throws:
OrmException

batchUpdate

ISqlBatchUpdate batchUpdate(String sql,
                            IPreparedStatementCreator psc)
                            throws OrmException
Issue multiple SQL updates on a single JDBC Statement using batching. The values on the generated PreparedStatement are set using an IPreparedStatementCreator.

Parameters:
sql - defining a List of SQL statements that will be executed.
psc - the creator to bind values on the PreparedStatement
Returns:
Throws:
OrmException


Copyright © 2011. All Rights Reserved.