.last()不是得到记录的行数,在jdk文档中如此描述:
public boolean last()
throws SQLException Moves the cursor to the last row in this ResultSet object. Returns:
true if the cursor is on a valid row; false if there are no rows in the result set
Throws:
SQLException - if a database access error occurs or the result set type is TYPE_FORWARD_ONLY
public boolean last()
throws SQLException Moves the cursor to the last row in this ResultSet object. Returns:
true if the cursor is on a valid row; false if there are no rows in the result set
Throws:
SQLException - if a database access error occurs or the result set type is TYPE_FORWARD_ONLY
解决方案 »
- eclipse中 java程序怎样调用python?
- 问题:jboss7.1.1+myeclipse10 项目部署成功,运行后出现的ERROR
- |javamy|.NET的const readonly在java中是不是以final代替,有示例代码 谢谢
- EXT JS if(store.modified.indexOf(p) == -1)什么意思
- jdbc连接池问题
- SSH 开发 tomcat 报错
- log4j console 不能输出,怎么回事?
- 大连想找一份不要求日语的JAVA工作!
- 为什么安装了weblogic 8.1后JBuilder中还是没有呢?
- CMP EJB的联合查询问题
- 急:如何能做到在tomcat中更改過servlet,而不用重新啟動tomcat,馬上結賬
- 新手问题:无法再打开VE编辑窗口?
if (rs.last())
{
count = rs.getRow();
}
用别的办法,比如select count
不过效率也不是很高,当数据量很大的时候。数据库索引对这个有影响
不同数据库实现还会不一样?这个能详细些吗?另外:
.last()内部过程是不是相当于(我知道结果是一样的,但关键是内部实现):
while(!(rs.isLast()))
{
rs.next();
}