If we have a table with 10 rows and we execute this query twice we get the wrong number of affected rows the second time.
Statement st = open();
st.executeUpdate("UPDATE `tickets` SET price=1000"); // return 10
st.executeUpdate("UPDATE `tickets` SET price=1000"); // return 10
Obviously it isn't correct because in first query the price of all rows is updated to 1000 and in the second query nothing actually changes but it returns 10 again!
How can I get the number of rows that are actually updated?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…