ResultSet rs = stmt.executeQuery("select count(*) from article where pid = " + pid);??? rs.next();??? int count = rs.getInt(1); 代碼已貼上,假設我想從數據庫中取出? pid=1 的數據條數?? 當我成功執行ResultSet rs = stmt.executeQuery("select count(*) from article where pid = " + pid);之后?? 不就已經得到一個返回的結果集了嗎?這里rs.next(); 的作用是什么?不懂為什么 沒有 rs.next();會報錯
關于ResultSet 結果集的問題
月亮島Superman
2017-08-10 16:26:17