求组 有什么好的方法
解决方案 »
- 国际问题中:bean:message key问题
- 为什么eclipse,代码走到断电后,就直接跳向Source not found警告页面啊
- servlet中使用javabean问题,顶者有分!
- struts.config.xml中的bean配置问题!
- javabean连接问题
- javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content
- [求教][动态的加载网页控件][高手快来]
- jsp跟 oracle连接问题 100分
- 救命啊???jsp
- 请问在jsp里面这样写struts的代码可以码?
- 怎样测试一个网页的响应速度
- 贡献一个prototype整合json实现无刷新验证用户名例子
<select id="findPaginated" parameterType="map" resultType="Channel">
select top $pagesize$ * from t_channel
where id not in(select top $offset$ id from t_channel)
<!-- limit #{offset},#{pagesize} -->
</select>
params.put("offset", String.valueOf(SystemContext.getOffset()));
params.put("pagesize", String.valueOf(SystemContext.getPagesize()));
datas = session.selectList(sqlId, params)
总是报下面的错
DEBUG [http-8081-Processor60] java.sql.Connection - ooo Connection Opened
DEBUG [http-8081-Processor60] java.sql.PreparedStatement - ==> Executing: select top $pagesize$ * from t_channel where id not in(select top $offset$ id from t_channel)
DEBUG [http-8081-Processor60] java.sql.PreparedStatement - ==> Parameters:
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: '$pagesize$' 附近有语法错误。
### The error may involve cn.com.leadfar.cms.backend.model.Channel.findPaginated-Inline
### The error occurred while setting parameters
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: '$pagesize$' 附近有语法错误。
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:61)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:53)
at cn.com.leadfar.cms.backend.dao.impl.BaseDao.findPaginated(BaseDao.java:118)
at cn.com.leadfar.cms.backend.dao.impl.ChannelDaoForMyBatisImpl.findChannels(ChannelDaoForMyBatisImpl.java:28)
at cn.com.leadfar.cms.site.NavServlet.navList(NavServlet.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI
String sql = 'select top ' +第一个变量+' id,name from tb where id not in (select top '+第二个变量+' id from tb)'执行。
oracle用的是rownum吧 sql server用的才是top