SELECT count (*) FROM table 在java中用什么接受到这个值??? SELECT count (*) FROM table 在java中用什么接受到这个值??? 具体点. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 此回复为自动发出,仅用于显示而已,并无任何其他特殊作用楼主【hanhan7750】截止到2008-07-09 13:51:26的历史汇总数据(不包括此帖):发帖的总数量:0 发帖的总分数:0 每贴平均分数:0 回帖的总数量:9 得分贴总数量:0 回帖的得分率:0% 结贴的总数量:0 结贴的总分数:0 无满意结贴数:0 无满意结贴分:0 未结的帖子数:0 未结的总分数:0 结贴的百分比:---------------------结分的百分比:---------------------无满意结贴率:---------------------无满意结分率:---------------------如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html SELECT count (*) FROM table 改成 SELECT count (*) cou FROM table rs.getInt("cou"); rs.getString()几乎可以接收所有类型的数据 int count = rs.getInt(0); SELECT count (*) as cou FROM table rs.getString("cou"); pstm = con.preparedStatement("select count(*) as num from table");rs = pstm.executeQuery();int total = rs.getInt(num); ConnectionBean cb=new ConnectionBean(); Connection con=cb.getConnection(); String sql="select count(*) from "+tableName; PreparedStatement preparedStatement=null; ResultSet rs=null; try { preparedStatement = con.prepareStatement(sql);// preparedStatement.setString(1,tableName); rs=preparedStatement.executeQuery(); if(rs.next()){ int page = rs.getInt(1); this.setRowCount(rs.getInt(1)); } } catch (SQLException ex) { ex.printStackTrace(); }finally{ cb.closeResultSet(rs); cb.closePreparedStatement(preparedStatement); cb.closeConnection(con); } this.setRowsPerPage(rowsPrerPage); this.setMaxPage(this.getRowCount()/this.getRowsPerPage()); 关于servlet里面使用OutputStream时路径的问题,谢谢 关于过滤后重定向页面的问题 有关WEBGIS的空间数据库 关于Spring的事务管理 tomcat6运行时只占32M内存问题,急!!在线等!!! 郁闷死我了呜呜,图片怎么显示不出来呢?路径没有错啊。。大家帮助些谢谢 求助时间问题? 关于jsp页面中sql语句插入超长的问题。急~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 小问题 页面跳转的问题 JSP网页显示出错,急!! 大家来讨论一下有关多文件上传问题。。。。。。。。。。
楼主【hanhan7750】截止到2008-07-09 13:51:26的历史汇总数据(不包括此帖):
发帖的总数量:0 发帖的总分数:0 每贴平均分数:0
回帖的总数量:9 得分贴总数量:0 回帖的得分率:0%
结贴的总数量:0 结贴的总分数:0
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:---------------------结分的百分比:---------------------
无满意结贴率:---------------------无满意结分率:---------------------
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
改成 SELECT count (*) cou FROM table rs.getInt("cou");
int count = rs.getInt(0);
rs.getString("cou");
rs = pstm.executeQuery();
int total = rs.getInt(num);
Connection con=cb.getConnection();
String sql="select count(*) from "+tableName;
PreparedStatement preparedStatement=null;
ResultSet rs=null;
try {
preparedStatement = con.prepareStatement(sql);
// preparedStatement.setString(1,tableName);
rs=preparedStatement.executeQuery();
if(rs.next()){
int page = rs.getInt(1);
this.setRowCount(rs.getInt(1));
}
} catch (SQLException ex) {
ex.printStackTrace();
}finally{
cb.closeResultSet(rs);
cb.closePreparedStatement(preparedStatement);
cb.closeConnection(con);
}
this.setRowsPerPage(rowsPrerPage);
this.setMaxPage(this.getRowCount()/this.getRowsPerPage());