/** * Convenience method to execute an update with no parameters. */ public int update() throws DataAccessException { return update(new Object[0]); }
/** * Convenient method to execute with two int parameters. * @param p1 first int parameter * @param p2 second int parameter */ public List<T> execute(int p1, int p2) throws DataAccessException { return execute(p1, p2, null); }
/** * Constructs an update object with a given DataSource and SQL. * @param ds the DataSource to use to obtain connections * @param sql the SQL statement to execute */ public SqlUpdate(DataSource ds, String sql) { setDataSource(ds); setSql(sql); }
/** * Create a new SqlFunction object with SQL, but without parameters. * Must add parameters or settle with none. * @param ds the DataSource to obtain connections from * @param sql the SQL to execute */ public SqlFunction(DataSource ds, String sql) { setRowsExpected(1); setDataSource(ds); setSql(sql); }
/** * Convenient constructor with a {@code DataSource} and SQL string. * @param ds the {@code DataSource} to use to get connections * @param sql the SQL to execute; SQL can also be supplied at runtime * by overriding the {@link #getSql()} method. */ public SqlQuery(DataSource ds, String sql) { setDataSource(ds); setSql(sql); }
/** * Create a new object wrapper for a stored procedure. * @param jdbcTemplate the JdbcTemplate which wraps DataSource * @param name name of the stored procedure in the database */ protected StoredProcedure(JdbcTemplate jdbcTemplate, String name) { setJdbcTemplate(jdbcTemplate); setSql(name); }
/** * Convenient method to run the function with a single int argument. * @param parameter single int parameter * @return the value of the function */ public int run(int parameter) { return run(new Object[] {parameter}); }
/** * Convenient method to execute without context. * @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. */ public List<T> executeByNamedParam(Map<String, ?> paramMap) throws DataAccessException { return executeByNamedParam(paramMap, null); }
public RequiredRowsUpdater() { setSql(UPDATE); setDataSource(dataSource); setRequiredRowsAffected(3); compile(); }
/** * Constructor to allow use as a JavaBean. */ public UpdatableSqlQuery() { setUpdatableResults(true); }
public Updater() { setSql(UPDATE); setDataSource(dataSource); compile(); }
/** * Ensures compilation if used in a bean factory. */ @Override public void afterPropertiesSet() { compile(); }
public Map<String, Object> executeTest() { return execute(new TestParameterMapper()); }
/** * Convenient method to execute an update given one int arg. */ public int update(int p1) throws DataAccessException { return update(new Object[] {p1}); }
/** * Convenient method to execute with a single String parameter. * @param p1 single String parameter */ public List<T> execute(String p1) throws DataAccessException { return execute(p1, null); }
/** * Convenient method to execute an update given one long arg. */ public int update(long p1) throws DataAccessException { return update(new Object[] {p1}); }
/** * Convenient method to execute without parameters nor context. */ public List<T> execute() throws DataAccessException { return execute((Object[]) null, null); }
/** * Convenient method to execute an update given two long args. */ public int update(long p1, long p2) throws DataAccessException { return update(new Object[] {p1, p2}); }
/** * Convenient method to execute with a single long parameter. * @param p1 single long parameter */ public List<T> execute(long p1) throws DataAccessException { return execute(p1, null); }
/** * Convenient method to execute without context. * @param params parameters for the query. Primitive parameters must * be represented by their Object wrapper type. The ordering of parameters is * significant. */ public List<T> execute(Object... params) throws DataAccessException { return execute(params, null); }