|
发表于 2007-3-30 15:54:37
|
显示全部楼层
public List queryByPage(int intRecordsPerPage,
int intCurrentPage, String sql) throws Exception {
List l=null;
if(sql==null||sql.trim().length()==0){
MyLog.errorLog(this.getClass(),null,"查询语句不能为空!");
return l;
}
Session session=DBConn.getConnection();
Query qry=session.createQuery(sql);
qry.setFirstResult(intCurrentPage);
qry.setMaxResults(intRecordsPerPage);
l=qry.list();
session.close();
return l;
} |
|