Mybatismysqlupdate: the number of affected rows returned is incorrect.

Source: Internet
Author: User
The database has an order table with a row of data order_id1555 (auto-incrementing primary key) and a tag field order_mark2 to execute the statement. use the mysql client tool QueryOK, 0 rowsaffected (0.00sec) Rowsmatched: 1 Changed: 0 Warnings: 0 use NavicatforMySQL tool to return [SQL] updatet_o... mysqlmybatis

The database has an order table.

There is a data row order_id = 1555 (auto-incrementing primary key), there is a tag field order_mark = 2

Execute the statement update t_order set order_mark = 2 where order_id = 1555.

Use the client tool provided by mysql

Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0

Returned by using Navicat for MySQL

[SQL] updatt_order set order_mark = 2 where order_id = 1555
Affected rows: 0
Time: 0.002 s

Use the datastudio tool to return

1 record (s) affected

In the project

Project source code:

Int I = orderDAO. updateOrderMark (orderId, ORDER_MARK.CHEAT.ordinal ());
If (I = 1 ){
Int userId = order. getDriverId ();

The returned I = 1;

Debug prints the executed SQL

Explain why the number of affected rows returned is 1, not 0.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.