public class JdbcTemplate extends Object implements JdbcOperations
| Constructor and Description |
|---|
JdbcTemplate() |
public <T> T execute(StatementCallback<T> action) throws DataAccessException
execute in interface JdbcOperationsDataAccessExceptionpublic void execute(String sql) throws DataAccessException
execute in interface JdbcOperationsDataAccessExceptionpublic <T> T query(String sql, ResultSetExtractor<T> rse) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic void query(String sql, RowCallbackHandler rch) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> query(String sql, RowMapper<T> rowMapper) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> T queryForObject(String sql, RowMapper<T> rowMapper) throws DataAccessException
queryForObject in interface JdbcOperationsDataAccessExceptionpublic <T> T queryForObject(String sql, Class<T> requiredType) throws DataAccessException
queryForObject in interface JdbcOperationsDataAccessExceptionpublic Map<String,Object> queryForMap(String sql) throws DataAccessException
queryForMap in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> queryForList(String sql, Class<T> elementType) throws DataAccessException
queryForList in interface JdbcOperationsDataAccessExceptionpublic List<Map<String,Object>> queryForList(String sql) throws DataAccessException
queryForList in interface JdbcOperationsDataAccessExceptionpublic SqlRowSet queryForRowSet(String sql) throws DataAccessException
queryForRowSet in interface JdbcOperationsDataAccessExceptionpublic int update(String sql) throws DataAccessException
JdbcOperationsupdate in interface JdbcOperationssql - static SQL to executeDataAccessException - if there is any problem.public int[] batchUpdate(String... sql) throws DataAccessException
JdbcOperationsWill fall back to separate updates on a single Statement if the JDBC driver does not support batch updates.
batchUpdate in interface JdbcOperationssql - defining an array of SQL statements that will be executed.DataAccessException - if there is any problem executing the batchpublic <T> T execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action) throws DataAccessException
execute in interface JdbcOperationsDataAccessExceptionpublic <T> T execute(String sql, PreparedStatementCallback<T> action) throws DataAccessException
execute in interface JdbcOperationsDataAccessExceptionpublic <T> T query(PreparedStatementCreator psc, ResultSetExtractor<T> rse) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> T query(String sql, PreparedStatementSetter pss, ResultSetExtractor<T> rse) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> T query(String sql, Object[] args, int[] argTypes, ResultSetExtractor<T> rse) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> T query(String sql, Object[] args, ResultSetExtractor<T> rse) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> T query(String sql, ResultSetExtractor<T> rse, Object... args) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic void query(PreparedStatementCreator psc, RowCallbackHandler rch) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic void query(String sql, PreparedStatementSetter pss, RowCallbackHandler rch) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic void query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic void query(String sql, Object[] args, RowCallbackHandler rch) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic void query(String sql, RowCallbackHandler rch, Object... args) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> query(PreparedStatementCreator psc, RowMapper<T> rowMapper) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> query(String sql, PreparedStatementSetter pss, RowMapper<T> rowMapper) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> query(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> query(String sql, Object[] args, RowMapper<T> rowMapper) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> query(String sql, RowMapper<T> rowMapper, Object... args) throws DataAccessException
query in interface JdbcOperationsDataAccessExceptionpublic <T> T queryForObject(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper) throws DataAccessException
queryForObject in interface JdbcOperationsDataAccessExceptionpublic <T> T queryForObject(String sql, Object[] args, RowMapper<T> rowMapper) throws DataAccessException
queryForObject in interface JdbcOperationsDataAccessExceptionpublic <T> T queryForObject(String sql, RowMapper<T> rowMapper, Object... args) throws DataAccessException
queryForObject in interface JdbcOperationsDataAccessExceptionpublic <T> T queryForObject(String sql, Object[] args, int[] argTypes, Class<T> requiredType) throws DataAccessException
queryForObject in interface JdbcOperationsDataAccessExceptionpublic <T> T queryForObject(String sql, Object[] args, Class<T> requiredType) throws DataAccessException
queryForObject in interface JdbcOperationsDataAccessExceptionpublic <T> T queryForObject(String sql, Class<T> requiredType, Object... args) throws DataAccessException
queryForObject in interface JdbcOperationsDataAccessExceptionpublic Map<String,Object> queryForMap(String sql, Object[] args, int[] argTypes) throws DataAccessException
queryForMap in interface JdbcOperationsDataAccessExceptionpublic Map<String,Object> queryForMap(String sql, Object... args) throws DataAccessException
queryForMap in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> queryForList(String sql, Object[] args, int[] argTypes, Class<T> elementType) throws DataAccessException
queryForList in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> queryForList(String sql, Object[] args, Class<T> elementType) throws DataAccessException
queryForList in interface JdbcOperationsDataAccessExceptionpublic <T> List<T> queryForList(String sql, Class<T> elementType, Object... args) throws DataAccessException
queryForList in interface JdbcOperationsDataAccessExceptionpublic List<Map<String,Object>> queryForList(String sql, Object[] args, int[] argTypes) throws DataAccessException
queryForList in interface JdbcOperationsDataAccessExceptionpublic List<Map<String,Object>> queryForList(String sql, Object... args) throws DataAccessException
queryForList in interface JdbcOperationsDataAccessExceptionpublic SqlRowSet queryForRowSet(String sql, Object[] args, int[] argTypes) throws DataAccessException
queryForRowSet in interface JdbcOperationsDataAccessExceptionpublic SqlRowSet queryForRowSet(String sql, Object... args) throws DataAccessException
queryForRowSet in interface JdbcOperationsDataAccessExceptionpublic int update(String sql, PreparedStatementSetter pss) throws DataAccessException
update in interface JdbcOperationsDataAccessExceptionpublic int update(String sql, Object[] args, int[] argTypes) throws DataAccessException
update in interface JdbcOperationsDataAccessExceptionpublic int update(String sql, Object... args) throws DataAccessException
update in interface JdbcOperationsDataAccessExceptionpublic int[] batchUpdate(String sql, BatchPreparedStatementSetter pss) throws DataAccessException
batchUpdate in interface JdbcOperationsDataAccessExceptionpublic int[] batchUpdate(String sql, List<Object[]> batchArgs) throws DataAccessException
batchUpdate in interface JdbcOperationsDataAccessExceptionpublic int[] batchUpdate(String sql, List<Object[]> batchArgs, int[] argTypes) throws DataAccessException
batchUpdate in interface JdbcOperationsDataAccessExceptionpublic <T> int[][] batchUpdate(String sql, Collection<T> batchArgs, int batchSize, ParameterizedPreparedStatementSetter<T> pss) throws DataAccessException
batchUpdate in interface JdbcOperationsDataAccessExceptionpublic <T> T execute(CallableStatementCreator csc, CallableStatementCallback<T> action) throws DataAccessException
execute in interface JdbcOperationsDataAccessExceptionpublic <T> T execute(String callString, CallableStatementCallback<T> action) throws DataAccessException
execute in interface JdbcOperationsDataAccessExceptionpublic Map<String,Object> call(CallableStatementCreator csc, List<SqlParameter> declaredParameters) throws DataAccessException
call in interface JdbcOperationsDataAccessExceptionpublic int queryForInt(String sql)
queryForInt in interface JdbcOperationspublic int queryForInt(String sql, Object[] args)
queryForInt in interface JdbcOperationspublic int queryForInt(String sql, Object[] args, int[] argTypes)
queryForInt in interface JdbcOperationspublic long queryForLong(String sql)
queryForLong in interface JdbcOperationspublic long queryForLong(String sql, Object[] args)
queryForLong in interface JdbcOperationspublic long queryForLong(String sql, Object[] args, int[] argTypes)
queryForLong in interface JdbcOperationsCopyright © 2022. All rights reserved.