Return number of rows affected by SQL UPDATE statement in Java

后端 未结 7 1935
花落未央
花落未央 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:45

    Calling executeUpdate() on your PreparedStatement should return an int, the number of updated records.

提交回复
热议问题