com.alexkasko.springjdbc.iterable
Interface IterableJdbcOperations

All Known Implementing Classes:
IterableJdbcTemplate

public interface IterableJdbcOperations

Extension interface for JdbcOperations. All methods, that return List mirrored with queryForIter methods that return CloseableIterator. Javadocs borrowed from JdbcOperations.

Author:
alexkasko Date: 11/7/12
See Also:
IterableNamedParameterJdbcOperations

Method Summary
<T> CloseableIterator<T>
queryForIter(org.springframework.jdbc.core.PreparedStatementCreator psc, org.springframework.jdbc.core.PreparedStatementSetter pss, org.springframework.jdbc.core.RowMapper<T> rowMapper)
          Query using a prepared statement, mapping each row to a Java object via a RowMapper.
<T> CloseableIterator<T>
queryForIter(org.springframework.jdbc.core.PreparedStatementCreator psc, org.springframework.jdbc.core.RowMapper<T> rowMapper)
          Query using a prepared statement, mapping each row to a Java object via a RowMapper.
 CloseableIterator<Map<String,Object>> queryForIter(String sql)
          Execute a query for a result iterator, given static SQL.
<T> CloseableIterator<T>
queryForIter(String sql, Class<T> elementType)
          Execute a query for a result шterator, given static SQL.
<T> CloseableIterator<T>
queryForIter(String sql, Class<T> elementType, Object... args)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.
 CloseableIterator<Map<String,Object>> queryForIter(String sql, Object... args)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.
<T> CloseableIterator<T>
queryForIter(String sql, Object[] args, Class<T> elementType)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.
 CloseableIterator<Map<String,Object>> queryForIter(String sql, Object[] args, int[] argTypes)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.
<T> CloseableIterator<T>
queryForIter(String sql, Object[] args, int[] argTypes, Class<T> elementType)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.
<T> CloseableIterator<T>
queryForIter(String sql, Object[] args, int[] argTypes, org.springframework.jdbc.core.RowMapper<T> rowMapper)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
<T> CloseableIterator<T>
queryForIter(String sql, Object[] args, org.springframework.jdbc.core.RowMapper<T> rowMapper)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
<T> CloseableIterator<T>
queryForIter(String sql, org.springframework.jdbc.core.PreparedStatementSetter pss, org.springframework.jdbc.core.RowMapper<T> rowMapper)
          Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a Java object via a RowMapper.
<T> CloseableIterator<T>
queryForIter(String sql, org.springframework.jdbc.core.RowMapper<T> rowMapper)
          Execute a query given static SQL, mapping each row to a Java object via a RowMapper.
<T> CloseableIterator<T>
queryForIter(String sql, org.springframework.jdbc.core.RowMapper<T> rowMapper, Object... args)
          Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 

Method Detail

queryForIter

<T> CloseableIterator<T> queryForIter(org.springframework.jdbc.core.PreparedStatementCreator psc,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper)
                                  throws org.springframework.dao.DataAccessException
Query using a prepared statement, mapping each row to a Java object via a RowMapper.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Parameters:
psc - object that can create a PreparedStatement given a Connection If this is null, the SQL will be assumed to contain no bind parameters.
rowMapper - object that will map one object per row
Returns:
the result Iterator, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if there is any problem
See Also:
PreparedStatementCreatorFactory

queryForIter

<T> CloseableIterator<T> queryForIter(org.springframework.jdbc.core.PreparedStatementCreator psc,
                                      org.springframework.jdbc.core.PreparedStatementSetter pss,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper)
                                  throws org.springframework.dao.DataAccessException
Query using a prepared statement, mapping each row to a Java object via a RowMapper.

A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory.

Parameters:
psc - object that can create a PreparedStatement given a Connection
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters.
rowMapper - object that will map one object per row
Returns:
the result Iterator, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if there is any problem
See Also:
PreparedStatementCreatorFactory

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper)
                                  throws org.springframework.dao.DataAccessException
Execute a query given static SQL, mapping each row to a Java object via a RowMapper.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForIter method with null as argument array.

Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
Returns:
the result Iterator, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if there is any problem executing the query
See Also:
queryForIter(String, Object[], RowMapper)

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      Class<T> elementType)
                                  throws org.springframework.dao.DataAccessException
Execute a query for a result шterator, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForIter method with null as argument array.

The results will be mapped to a Iterator (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
elementType - the required type of element in the result шterator (for example, Integer.class)
Returns:
an Iterator of objects that match the specified element type
Throws:
org.springframework.dao.DataAccessException - if there is any problem executing the query
See Also:
queryForIter(String, Object[], Class), SingleColumnRowMapper

queryForIter

CloseableIterator<Map<String,Object>> queryForIter(String sql)
                                                   throws org.springframework.dao.DataAccessException
Execute a query for a result iterator, given static SQL.

Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForIter method with null as argument array.

The results will be mapped to a Iterator (one entry for each row) of Maps (one entry for each column using the column name as the key). Each element in the iterator will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
Returns:
an Iterator that contains a Map per row
Throws:
org.springframework.dao.DataAccessException - if there is any problem executing the query
See Also:
queryForIter(String, Object[])

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      org.springframework.jdbc.core.PreparedStatementSetter pss,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a PreparedStatementSetter implementation that knows how to bind values to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
pss - object that knows how to set values on the prepared statement. If this is null, the SQL will be assumed to contain no bind parameters. Even if there are no bind parameters, this object may be used to set fetch size and other performance options.
rowMapper - object that will map one object per row
Returns:
the result Iterator, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if the query fails

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      Object[] args,
                                      int[] argTypes,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
rowMapper - object that will map one object per row
Returns:
the result Iterator, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
Types

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      Object[] args,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
rowMapper - object that will map one object per row
Returns:
the result Iterator, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if the query fails

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      org.springframework.jdbc.core.RowMapper<T> rowMapper,
                                      Object... args)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.

Parameters:
sql - SQL query to execute
rowMapper - object that will map one object per row
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
the result List, containing mapped objects
Throws:
org.springframework.dao.DataAccessException - if the query fails

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      Object[] args,
                                      int[] argTypes,
                                      Class<T> elementType)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.

The results will be mapped to a Iterator (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
elementType - the required type of element in the result iterator (for example, Integer.class)
Returns:
a Iterator of objects that match the specified element type
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
queryForIter(String, Class), SingleColumnRowMapper

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      Object[] args,
                                      Class<T> elementType)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.

The results will be mapped to an Iterator (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
elementType - the required type of element in the result iterator (for example, Integer.class)
Returns:
an Iterator of objects that match the specified element type
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
queryForIter(String, Class), SingleColumnRowMapper

queryForIter

<T> CloseableIterator<T> queryForIter(String sql,
                                      Class<T> elementType,
                                      Object... args)
                                  throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.

The results will be mapped to an Iterator (one entry for each row) of result objects, each of them matching the specified element type.

Parameters:
sql - SQL query to execute
elementType - the required type of element in the result iterator (for example, Integer.class)
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
an Iterator of objects that match the specified element type
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
queryForIter(String, Class), SingleColumnRowMapper

queryForIter

CloseableIterator<Map<String,Object>> queryForIter(String sql,
                                                   Object[] args,
                                                   int[] argTypes)
                                                   throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.

The results will be mapped to an Iterator (one entry for each row) of Maps (one entry for each column, using the column name as the key). Thus Each element in the iterator will be of the form returned by JdbcOperations' queryForMap() methods.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
argTypes - SQL types of the arguments (constants from java.sql.Types)
Returns:
an Iterator that contains a Map per row
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
queryForIter(String), Types

queryForIter

CloseableIterator<Map<String,Object>> queryForIter(String sql,
                                                   Object... args)
                                                   throws org.springframework.dao.DataAccessException
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result iterator.

The results will be mapped to an Iterator (one entry for each row) of Maps (one entry for each column, using the column name as the key). Each element in the iterator will be of the form returned by this interface's queryForMap() methods.

Parameters:
sql - SQL query to execute
args - arguments to bind to the query (leaving it to the PreparedStatement to guess the corresponding SQL type); may also contain SqlParameterValue objects which indicate not only the argument value but also the SQL type and optionally the scale
Returns:
an Iterator that contains a Map per row
Throws:
org.springframework.dao.DataAccessException - if the query fails
See Also:
queryForIter(String)


Copyright © 2013. All Rights Reserved.