Return number of rows affected by SQL UPDATE statement in Java

后端 未结 7 1963
花落未央
花落未央 2020-12-30 20:26

I\'m using a MySQL database and accessing it through Java.

PreparedStatement prep1 = this.connection.prepareStatement(
        \"UPDATE user_table 
                


        
7条回答
  •  情深已故
    2020-12-30 20:33

    If it is necessary to know how many rows will be affected without executing it, you will have to run a SELECT statement first.

提交回复
热议问题