接口 net.hasor.jdbc.SqlParameterSource
的使用

使用 SqlParameterSource 的软件包
net.hasor.jdbc Hasor Jdbc Operations. 
net.hasor.jdbc.core   
net.hasor.jdbc.core.source   
net.hasor.jdbc.core.util   
 

net.hasor.jdbcSqlParameterSource 的使用
 

参数类型为 SqlParameterSourcenet.hasor.jdbc 中的方法
 int[] JdbcOperations.batchUpdate(String sql, SqlParameterSource[] batchArgs)
          批量执行 SQL 语句,这一批次中的SQL 参数使用 BatchPreparedStatementSetter 接口设置。
<T> T
JdbcOperations.execute(String sql, SqlParameterSource paramSource, PreparedStatementCallback<T> action)
          执行一个 JDBC 操作。
<T> T
JdbcOperations.query(String sql, SqlParameterSource paramSource, ResultSetExtractor<T> rse)
          查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作,并且将 SQL 查询结果集使用 ResultSetExtractor 转换。
 void JdbcOperations.query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch)
          查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作,并且结果集行处理使用 RowCallbackHandler 接口处理。
<T> List<T>
JdbcOperations.query(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
          查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
 int JdbcOperations.queryForInt(String sql, SqlParameterSource paramSource)
          查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
 List<Map<String,Object>> JdbcOperations.queryForList(String sql, SqlParameterSource paramSource)
          查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
<T> List<T>
JdbcOperations.queryForList(String sql, SqlParameterSource paramSource, Class<T> elementType)
          查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
 long JdbcOperations.queryForLong(String sql, SqlParameterSource paramSource)
          查询一个 SQL 语句,sql 参数通过 SqlParameterSource 封装。
 Map<String,Object> JdbcOperations.queryForMap(String sql, SqlParameterSource paramSource)
          查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
<T> T
JdbcOperations.queryForObject(String sql, SqlParameterSource paramSource, Class<T> requiredType)
          查询一个 SQL 语句,查询参数使用 SqlParameterSource 封装,并将查询结果使用 requiredType 参数表示的类型返回。
<T> T
JdbcOperations.queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
          查询一个 SQL 语句,查询参数使用 SqlParameterSource 封装。
 SqlRowSet JdbcOperations.queryForRowSet(String sql, SqlParameterSource paramSource)
          查询一个 SQL 语句,使用这个查询将会使用 PreparedStatement 接口操作。
 int JdbcOperations.update(String sql, SqlParameterSource paramSource)
          执行一个更新语句(insert、update、delete),这个查询将会使用 PreparedStatement 接口操作。
 

net.hasor.jdbc.coreSqlParameterSource 的使用
 

参数类型为 SqlParameterSourcenet.hasor.jdbc.core 中的方法
 int[] JdbcTemplate.batchUpdate(String sql, SqlParameterSource[] batchArgs)
           
<T> T
JdbcTemplate.execute(String sql, SqlParameterSource paramSource, PreparedStatementCallback<T> action)
           
protected  PreparedStatementCreator JdbcTemplate.getPreparedStatementCreator(String sql, SqlParameterSource paramSource)
          Build a PreparedStatementCreator based on the given SQL and named parameters.
<T> T
JdbcTemplate.query(String sql, SqlParameterSource paramSource, ResultSetExtractor<T> rse)
           
 void JdbcTemplate.query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch)
           
<T> List<T>
JdbcTemplate.query(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
           
 int JdbcTemplate.queryForInt(String sql, SqlParameterSource paramSource)
           
 List<Map<String,Object>> JdbcTemplate.queryForList(String sql, SqlParameterSource paramSource)
           
<T> List<T>
JdbcTemplate.queryForList(String sql, SqlParameterSource paramSource, Class<T> elementType)
           
 long JdbcTemplate.queryForLong(String sql, SqlParameterSource paramSource)
           
 Map<String,Object> JdbcTemplate.queryForMap(String sql, SqlParameterSource paramSource)
           
<T> T
JdbcTemplate.queryForObject(String sql, SqlParameterSource paramSource, Class<T> requiredType)
           
<T> T
JdbcTemplate.queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
           
 SqlRowSet JdbcTemplate.queryForRowSet(String sql, SqlParameterSource paramSource)
           
 int JdbcTemplate.update(String sql, SqlParameterSource paramSource)
           
 

net.hasor.jdbc.core.sourceSqlParameterSource 的使用
 

实现 SqlParameterSourcenet.hasor.jdbc.core.source 中的类
 class AbstractSqlParameterSource
          Abstract base class for SqlParameterSource implementations.
 class MapSqlParameterSource
          SqlParameterSource implementation that holds a given Map of parameters.
 

net.hasor.jdbc.core.utilSqlParameterSource 的使用
 

参数类型为 SqlParameterSourcenet.hasor.jdbc.core.util 中的方法
static int[] NamedParameterUtils.buildSqlTypeArray(ParsedSql parsedSql, SqlParameterSource paramSource)
          Convert a Map of parameter types to a corresponding int array.
static Object[] NamedParameterUtils.buildValueArray(ParsedSql parsedSql, SqlParameterSource paramSource, List<SqlParameter> declaredParams)
          Convert a Map of named parameter values to a corresponding array.
static int[] NamedBatchUpdateUtils.executeBatchUpdateWithNamedParameters(ParsedSql parsedSql, SqlParameterSource[] batchArgs, JdbcOperations jdbcOperations)
           
static String NamedParameterUtils.substituteNamedParameters(ParsedSql parsedSql, SqlParameterSource paramSource)
          Parse the SQL statement and locate any placeholders or named parameters.
static String NamedParameterUtils.substituteNamedParameters(String sql, SqlParameterSource paramSource)
          Parse the SQL statement and locate any placeholders or named parameters.
 



Copyright © 2013-2014. All Rights Reserved.