strSQL="select count(*) as total from table"rs.getInt("total")
解决方案 »
- 网络编程中浏览器向服务器发请求时里包含的Host信息啥意思,不解
- 如何截取字符串中的非零字段?
- 这是什么意思?
- Statement执行SQL语句时遇到的日期格式难题
- 内部类实例化
- 【菜鸟问题】服务器端保持监听端口(Socket)的问题!
- 如何实现将一个JMenu下的JMenuItem用鼠标拖动到另一JMenu下
- Calebdar与Date的问题,救命啊
- 什么是JAVADOC?
- 正则表达式
- 请问现在都用什么东东来写JAVA程序,VJ++或JDK?还是其它的什么东东?有什么特点?
- Where can download VisualAge for Java 3.0 Enterprise Edition ?
int iRowCnt = rs.getRow(); //the row count is here :-)
rs.beforeFirst();
...
//begin normal process.
rs.next() ...
(
(select * from xxx where ....)tab_1,
(select count(*) from xxx where ...)tab_2,
)
rs.getInt("total") 比较好!
如果使用 ResultSet rs = stmt.ExecuteQuery(strSql);
rs.last();
int iRowCnt = rs.getRow(); 需要java2支持!所以我建议使用
count()