0
未來我有下面的代碼:無數據結果集
string query = select COUNT(*) from TRACKER where TYPE = ? and LAST_MODIFIED_TIME > LAST_RETREIVED_TIME;
prepStmt = connection.prepareStatement(query);
prepStmt.setString(1, "xml");
resultset = prepStmt.executeQuery();
resultset.next();
int rowcount = resultset.getInt("COUNT(*)");
在數據庫中,我有1列以上查詢,但在代碼中我得到的行數= 0 任何幫助嗎?
見http://stackoverflow.com/questions/7886462/get-row-count-of-a-resultset-in-java – devnull
分貝是甲骨文。我在那裏檢查,我得到1作爲輸出 – Aquarius24
嘗試給你的'COUNT(*)'列ALIAS,然後檢查。 '從...中選擇COUNT(*)res並使用'int rowcount = resultset.getInt(「res」);' – asifsid88