Java Code Examples for org.springframework.jdbc.core.namedparam.NamedParameterUtils

The following examples show how to use org.springframework.jdbc.core.namedparam.NamedParameterUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: gemini   Source File: TransactionImpl.java    License: Apache License 2.0 5 votes vote down vote up
private PreparedStatement getPreparedStatement(String sql, @Nullable Map<String, ?> parameters, boolean returnKeys) throws SQLException {
    SqlParameterSource paramSource = new MapSqlParameterSource(parameters);
    ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    List<SqlParameter> declaredParameters = NamedParameterUtils.buildSqlParameterList(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, null);
    PreparedStatementCreatorFactory psCreatorFactory = new PreparedStatementCreatorFactory(sqlToUse, declaredParameters);
    psCreatorFactory.setReturnGeneratedKeys(returnKeys);
    PreparedStatementCreator psCreator = psCreatorFactory.newPreparedStatementCreator(params);
    PreparedStatement preparedStatement = psCreator.createPreparedStatement(connection);
    logger.debug(preparedStatement.unwrap(PreparedStatement.class).toString());
    return preparedStatement;
}
 
Example 2
Source Project: spring-analysis-note   Source File: SqlOperation.java    License: MIT License 5 votes vote down vote up
/**
 * Obtain a parsed representation of this operation's SQL statement.
 * <p>Typically used for named parameter parsing.
 */
protected ParsedSql getParsedSql() {
	synchronized (this.parsedSqlMonitor) {
		if (this.cachedSql == null) {
			this.cachedSql = NamedParameterUtils.parseSqlStatement(resolveSql());
		}
		return this.cachedSql;
	}
}
 
Example 3
Source Project: spring-analysis-note   Source File: SqlUpdate.java    License: MIT License 5 votes vote down vote up
/**
 * Generic method to execute the update given named parameters.
 * All other update methods invoke this method.
 * @param paramMap a Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params));
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 4
Source Project: spring-analysis-note   Source File: SqlUpdate.java    License: MIT License 5 votes vote down vote up
/**
 * Method to execute the update given arguments and
 * retrieve the generated keys using a KeyHolder.
 * @param paramMap a Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @param generatedKeyHolder the KeyHolder that will hold the generated keys
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap, KeyHolder generatedKeyHolder) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params), generatedKeyHolder);
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 5
Source Project: java-technology-stack   Source File: SqlOperation.java    License: MIT License 5 votes vote down vote up
/**
 * Obtain a parsed representation of this operation's SQL statement.
 * <p>Typically used for named parameter parsing.
 */
protected ParsedSql getParsedSql() {
	synchronized (this.parsedSqlMonitor) {
		if (this.cachedSql == null) {
			this.cachedSql = NamedParameterUtils.parseSqlStatement(resolveSql());
		}
		return this.cachedSql;
	}
}
 
Example 6
Source Project: java-technology-stack   Source File: SqlUpdate.java    License: MIT License 5 votes vote down vote up
/**
 * Generic method to execute the update given named parameters.
 * All other update methods invoke this method.
 * @param paramMap a Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params));
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 7
Source Project: java-technology-stack   Source File: SqlUpdate.java    License: MIT License 5 votes vote down vote up
/**
 * Method to execute the update given arguments and
 * retrieve the generated keys using a KeyHolder.
 * @param paramMap a Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @param generatedKeyHolder the KeyHolder that will hold the generated keys
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap, KeyHolder generatedKeyHolder) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params), generatedKeyHolder);
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 8
Source Project: lams   Source File: SqlOperation.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtain a parsed representation of this operation's SQL statement.
 * <p>Typically used for named parameter parsing.
 */
protected ParsedSql getParsedSql() {
	synchronized (this.parsedSqlMonitor) {
		if (this.cachedSql == null) {
			this.cachedSql = NamedParameterUtils.parseSqlStatement(getSql());
		}
		return this.cachedSql;
	}
}
 
Example 9
Source Project: lams   Source File: SqlUpdate.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generic method to execute the update given named parameters.
 * All other update methods invoke this method.
 * @param paramMap Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params));
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 10
Source Project: lams   Source File: SqlUpdate.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Method to execute the update given arguments and
 * retrieve the generated keys using a KeyHolder.
 * @param paramMap Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @param generatedKeyHolder KeyHolder that will hold the generated keys
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap, KeyHolder generatedKeyHolder) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params), generatedKeyHolder);
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 11
Source Project: ureport   Source File: DatasourceServletAction.java    License: Apache License 2.0 5 votes vote down vote up
protected PreparedStatementCreator getPreparedStatementCreator(String sql, SqlParameterSource paramSource) {
	ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, null);
	List<SqlParameter> declaredParameters = NamedParameterUtils.buildSqlParameterList(parsedSql, paramSource);
	PreparedStatementCreatorFactory pscf = new PreparedStatementCreatorFactory(sqlToUse, declaredParameters);
	return pscf.newPreparedStatementCreator(params);
}
 
Example 12
Source Project: spring4-understanding   Source File: SqlOperation.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Obtain a parsed representation of this operation's SQL statement.
 * <p>Typically used for named parameter parsing.
 */
protected ParsedSql getParsedSql() {
	synchronized (this.parsedSqlMonitor) {
		if (this.cachedSql == null) {
			this.cachedSql = NamedParameterUtils.parseSqlStatement(getSql());
		}
		return this.cachedSql;
	}
}
 
Example 13
Source Project: spring4-understanding   Source File: SqlUpdate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Generic method to execute the update given named parameters.
 * All other update methods invoke this method.
 * @param paramMap Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params));
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 14
Source Project: spring4-understanding   Source File: SqlUpdate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Method to execute the update given arguments and
 * retrieve the generated keys using a KeyHolder.
 * @param paramMap Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @param generatedKeyHolder KeyHolder that will hold the generated keys
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap, KeyHolder generatedKeyHolder) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params), generatedKeyHolder);
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 15
Source Project: SimpleFlatMapper   Source File: MappingSqlQuery.java    License: MIT License 5 votes vote down vote up
public List<T> executeByNamedParam(Map<String, ?> paramMap, Map<?, ?> context) throws DataAccessException {
    validateNamedParameters(paramMap);
    ParsedSql parsedSql = getParsedSql();
    MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
    return query(newPreparedStatementCreator(sqlToUse, params));
}
 
Example 16
Source Project: effectivejava   Source File: SqlOperation.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Obtain a parsed representation of this operation's SQL statement.
 * <p>Typically used for named parameter parsing.
 */
protected ParsedSql getParsedSql() {
	synchronized (this.parsedSqlMonitor) {
		if (this.cachedSql == null) {
			this.cachedSql = NamedParameterUtils.parseSqlStatement(getSql());
		}
		return this.cachedSql;
	}
}
 
Example 17
Source Project: effectivejava   Source File: SqlUpdate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Generic method to execute the update given named parameters.
 * All other update methods invoke this method.
 * @param paramMap Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params));
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 18
Source Project: effectivejava   Source File: SqlUpdate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Method to execute the update given arguments and
 * retrieve the generated keys using a KeyHolder.
 * @param paramMap Map of parameter name to parameter object,
 * matching named parameters specified in the SQL statement
 * @param generatedKeyHolder KeyHolder that will hold the generated keys
 * @return the number of rows affected by the update
 */
public int updateByNamedParam(Map<String, ?> paramMap, KeyHolder generatedKeyHolder) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params), generatedKeyHolder);
	checkRowsAffected(rowsAffected);
	return rowsAffected;
}
 
Example 19
/**
 * Build a {@link PreparedStatementCreator} based on the given SQL and named parameters.
 * <p>Note: Directly called from all {@code query} variants.
 * Not used for the {@code update} variant with generated key handling.
 *
 * @param sql         the SQL statement to execute
 * @param paramSource container of arguments to bind
 * @return the corresponding {@link PreparedStatementCreator}
 */
@Override
protected PreparedStatementCreator getPreparedStatementCreator(String sql, SqlParameterSource paramSource) {
    ParsedSql parsedSql = getParsedSql(sql);
    PreparedStatementCreatorFactory pscf = getPreparedStatementCreatorFactory(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, null);
    return pscf.newPreparedStatementCreator(params);
}
 
Example 20
/**
 * Build a {@link PreparedStatementCreatorFactory} based on the given SQL and named parameters.
 *
 * @param parsedSql   parsed representation of the given SQL statement
 * @param paramSource container of arguments to bind
 * @return the corresponding {@link PreparedStatementCreatorFactory}
 * @see #getParsedSql(String)
 * @since Spring 5.1.3
 */
protected PreparedStatementCreatorFactory getPreparedStatementCreatorFactory(
        ParsedSql parsedSql, SqlParameterSource paramSource) {
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    List<SqlParameter> declaredParameters = NamedParameterUtils.buildSqlParameterList(parsedSql, paramSource);
    return new NamedParameterPreparedStatementCreatorFactory(sqlToUse, declaredParameters);
}
 
Example 21
Source Project: spring-analysis-note   Source File: SqlQuery.java    License: MIT License 3 votes vote down vote up
/**
 * Central execution method. All named parameter execution goes through this method.
 * @param paramMap parameters associated with the name specified while declaring
 * the SqlParameters. Primitive parameters must be represented by their Object wrapper
 * type. The ordering of parameters is not significant since they are supplied in a
 * SqlParameterMap which is an implementation of the Map interface.
 * @param context contextual information passed to the {@code mapRow}
 * callback method. The JDBC operation itself doesn't rely on this parameter,
 * but it can be useful for creating the objects of the result list.
 * @return a List of objects, one per row of the ResultSet. Normally all these
 * will be of the same class, although it is possible to use different types.
 */
public List<T> executeByNamedParam(Map<String, ?> paramMap, @Nullable Map<?, ?> context) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	RowMapper<T> rowMapper = newRowMapper(params, context);
	return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper);
}
 
Example 22
Source Project: java-technology-stack   Source File: SqlQuery.java    License: MIT License 3 votes vote down vote up
/**
 * Central execution method. All named parameter execution goes through this method.
 * @param paramMap parameters associated with the name specified while declaring
 * the SqlParameters. Primitive parameters must be represented by their Object wrapper
 * type. The ordering of parameters is not significant since they are supplied in a
 * SqlParameterMap which is an implementation of the Map interface.
 * @param context contextual information passed to the {@code mapRow}
 * callback method. The JDBC operation itself doesn't rely on this parameter,
 * but it can be useful for creating the objects of the result list.
 * @return a List of objects, one per row of the ResultSet. Normally all these
 * will be of the same class, although it is possible to use different types.
 */
public List<T> executeByNamedParam(Map<String, ?> paramMap, @Nullable Map<?, ?> context) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	RowMapper<T> rowMapper = newRowMapper(params, context);
	return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper);
}
 
Example 23
Source Project: lams   Source File: SqlQuery.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * Central execution method. All named parameter execution goes through this method.
 * @param paramMap parameters associated with the name specified while declaring
 * the SqlParameters. Primitive parameters must be represented by their Object wrapper
 * type. The ordering of parameters is not significant since they are supplied in a
 * SqlParameterMap which is an implementation of the Map interface.
 * @param context contextual information passed to the {@code mapRow}
 * callback method. The JDBC operation itself doesn't rely on this parameter,
 * but it can be useful for creating the objects of the result list.
 * @return a List of objects, one per row of the ResultSet. Normally all these
 * will be of the same class, although it is possible to use different types.
 */
public List<T> executeByNamedParam(Map<String, ?> paramMap, Map<?, ?> context) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	RowMapper<T> rowMapper = newRowMapper(params, context);
		return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper);
}
 
Example 24
Source Project: spring4-understanding   Source File: SqlQuery.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Central execution method. All named parameter execution goes through this method.
 * @param paramMap parameters associated with the name specified while declaring
 * the SqlParameters. Primitive parameters must be represented by their Object wrapper
 * type. The ordering of parameters is not significant since they are supplied in a
 * SqlParameterMap which is an implementation of the Map interface.
 * @param context contextual information passed to the {@code mapRow}
 * callback method. The JDBC operation itself doesn't rely on this parameter,
 * but it can be useful for creating the objects of the result list.
 * @return a List of objects, one per row of the ResultSet. Normally all these
 * will be of the same class, although it is possible to use different types.
 */
public List<T> executeByNamedParam(Map<String, ?> paramMap, Map<?, ?> context) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	RowMapper<T> rowMapper = newRowMapper(params, context);
		return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper);
}
 
Example 25
Source Project: effectivejava   Source File: SqlQuery.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Central execution method. All named parameter execution goes through this method.
 * @param paramMap parameters associated with the name specified while declaring
 * the SqlParameters. Primitive parameters must be represented by their Object wrapper
 * type. The ordering of parameters is not significant since they are supplied in a
 * SqlParameterMap which is an implementation of the Map interface.
 * @param context contextual information passed to the {@code mapRow}
 * callback method. The JDBC operation itself doesn't rely on this parameter,
 * but it can be useful for creating the objects of the result list.
 * @return a List of objects, one per row of the ResultSet. Normally all these
 * will be of the same class, although it is possible to use different types.
 */
public List<T> executeByNamedParam(Map<String, ?> paramMap, Map<?, ?> context) throws DataAccessException {
	validateNamedParameters(paramMap);
	ParsedSql parsedSql = getParsedSql();
	MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
	String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
	Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
	RowMapper<T> rowMapper = newRowMapper(params, context);
		return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper);
}