没有,你可以用next()来取数目。
public int getMount(Resultset re)
if(re != null)
{
int i = 0;
while(re.next())
i++;
return i;
}
else return 0;//or throw a Exception here
}
public int getMount(Resultset re)
if(re != null)
{
int i = 0;
while(re.next())
i++;
return i;
}
else return 0;//or throw a Exception here
}
1.用sql语句获得
rs.executeQuery("select count(*) from tablename");
rs.next();
int rsCount=rs.getInt(1);
2.用last和getRows方法,如下:
rs.executeQuery("select * from tablename");
rs.last();
int rsCount=rs.getRow();
rs.beforeFirst();