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

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

net.hasor.db.jdbcSqlParameterSource 的使用
 

参数类型为 SqlParameterSourcenet.hasor.db.jdbc 中的方法
 int[] JdbcOperations.batchUpdate(String sql, SqlParameterSource[] batchArgs)
          批量执行 insert 或 update、delete 语句,这一批次中的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 封装。
 int JdbcOperations.update(String sql, SqlParameterSource paramSource)
          执行一个更新语句(insert、update、delete),这个查询将会使用 PreparedStatement 接口操作。
 

net.hasor.db.jdbc.coreSqlParameterSource 的使用
 

参数类型为 SqlParameterSourcenet.hasor.db.jdbc.core 中的方法
 int[] JdbcTemplate.batchUpdate(String sql, SqlParameterSource[] batchArgs)
           
static String ParsedSql.buildSql(ParsedSql parsedSql, SqlParameterSource paramSource)
          生成SQL
static Object[] ParsedSql.buildSqlValues(ParsedSql parsedSql, SqlParameterSource paramSource)
          生成Values
<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)
           
 int JdbcTemplate.update(String sql, SqlParameterSource paramSource)
           
 



Copyright © 2014. All rights reserved.