当前位置: 技术问答>java相关
请问取得resultset后,如何得出记录集的总数
来源: 互联网 发布时间:2015-08-06
本文导语: 谢谢 | Statement st =conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); ResultSet rs = st.executeQuery("select * from t1"); rs.last(); //将游标移至最后 int count = rs.getRow();//获得记录总数 ...
谢谢
|
Statement st =conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs = st.executeQuery("select * from t1");
rs.last(); //将游标移至最后
int count = rs.getRow();//获得记录总数
ResultSet rs = st.executeQuery("select * from t1");
rs.last(); //将游标移至最后
int count = rs.getRow();//获得记录总数