/**
* Executes a mapped SQL SELECT statement that returns data to populate
* a number of result objects within a certain range.
* <p/>
* The parameter object is generally used to supply the input
* data for the WHERE clause parameter(s) of the SELECT statement.
*
* @param id The name of the statement to execute.
* @param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).
* @param skip The number of results to ignore.
* @param max The maximum number of results to return.
* @return A List of result objects.
* @throws java.sql.SQLException If an error occurs.
*/
List queryForList(String id, Object parameterObject, int skip, int max) throws SQLException;
测试,针对oracle为例,原始SQL :
select * from table
经该方法封装后的SQL:
select * from ( select row_limit.*, rownum rownum_ from (select * from table ) row_limit where rownum <= (skip+max) ) where rownum_ >max
分享到:
相关推荐
public List<Map<String, Object>> search(String sql, Map<String, Object> params) throws DaoAccessException { try { logger.debug(sql); return namedParameterJdbcTemplate.queryForList(sql, params...
主要介绍了Java实现Json字符串与Object对象相互转换的方式,结合实例形式总结分析了java基于Json-Lib、Org.Json、Jackson、Gson、FastJson五种方式转换json类型相关操作技巧,需要的朋友可以参考下
主要介绍了Java 使用JdbcTemplate 中的queryForList发生错误解决办法的相关资料,需要的朋友可以参考下
} <br> public boolean updatePassword(String username, String oldPassword, String newPassword) { if(!newPassword.matches(User.REGEX_PASSWORD)) return false; return 1==HibernateUtil....
该项目采用springmvc+spring+springjdbc框架+mysql框架实现 包含了jdbcTemplate的使用。queryForList,匿名内部类方式查询。 将List<Map<String,Object>>转换成List方法。
适合初学者,主要写了单表的增删改,主要配置文件的介绍,还有多表一对多,多对一的查询例子,分别用了mysql(多表的),和sqlserver(设计单表的),
B .iBATIS自带的queryForList(String statementName,int start,int size)分页接口有性能隐患,不允许使用。 C .定义明确的sql查询语句,通过传入参数start和size来实现分页逻辑。 D .可使用存储过程写分页逻辑...
ibatis学习 ibatis总结 ibatis ibatis ibatis
远程备份linux系统oracle以及导入
-- Insert example, using the Account parameter class --> <insert id="insertAccount" parameterClass="Account"> insert into ACCOUNT ( ACC_ID, ACC_FIRST_NAME, ACC_LAST_NAME, ACC_EMAIL )...
主要介绍了使用jdbcTemplate查询返回自定义对象集合代码示例,分享了相关代码示例,小编觉得还是挺不错的,具有一定借鉴价值,需要的朋友可以参考下
spring的良好的扩展性,集成度,IOC,AOP事务,已经是项目的基础条件. ... String userName= baseFangService.queryForObjectByByFunction(finder,String.class); System.out.println(userName); }
有的时候,我们需要一次查询很多的数据,或者是说每次查询的数据量都很大,都有可能早晨内存溢出的情况,所以我们今天分别针对三个数据库来探讨如何避免这一问题。
查询所有的内容,封装为list用 :template.queryForList(sql) 查询所有的内容,封装为对象用:template.query(sql, new BeanPropertyRowMapper<对象>(对象.class)); 查询需要使用聚合函数的内容,如:select count...
ibatis 源码 例子 包含 源码,jar都有 部分代码 package com.icss.dao; import java.io.IOException;...import java.io.Reader;...import java.sql.SQLException;... return sqlMapper.queryForList("selectAll");
查询类型处理Express req.query对象的数字和布尔值。设置 $ npm install --save query-types用法 var queryType = require ( 'query-types' ) ;var express = require ( 'express' ) ;app . use ( queryType ....
• queryForObject和queryForList都可以缓存。其它片断不支持。 • 可以设定为定时刷新或受条件触发刷新Key。如:在执行Update的时候,可以刷新Cache。 刷新Cache时,无法手动控制刷新单条记录。只能刷新该Cache ID...
ArrayList<User> uList = (ArrayList) client.queryForList("selectAllUser"); for (User u:uList) { System.out.print(u.getUname()); System.out.println(u.getUpwd()); }
spring-jdbc-operations 演示Spirng JDBCTemplate操作,例如query(),queryForObject(),QueryForList()以及如何使用PreparedStatementCreator检索自动生成的键。 #技术堆栈。 Spring JDBC。 HSQL InMemory...