MyBatis Bulk Delete error code 1064, SQL state 42000;

Source: Internet
Author: User

(a) a small record.

(b): The most recent projects are using MyBatis, batch add their own will write, but a batch delete can give me to toss the next, writing online have, but do not do, and finally asked the company's people, ask netizens to get the answer, That is, JDBC needs to be specified in the URL to allow multiple statements to be executed at the same time.

I write the batch update when the corresponding statements are printed out, copy out the implementation is no problem, but with JUnit test has been the error as follows

Error code 1064, SQL State 42000:you has an error in your SQL syntax;

Finally my configuration is to add "allowmultiqueries=true" to the URL in jdbc.properties

jdbc.url=jdbc:mysql://localhost:3306/test?allowmultiqueries=true&useunicode=true&characterencoding= Utf-8&zerodatetimebehavior=converttonull
This allows your batch update to be executed.
Here is a more in-depth can see http://my.oschina.net/zhuguowei/blog/411853
(c): This question is I ask the netizen to find the result, actually oneself if calm down think should still can think of, because oneself the printing code copy out directly in the database command line form is can execute, then oneself that time should think is not mybatis not support, But I always thought it was a SQL problem. The direction of finding the problem is wrong. It is also a value search MyBatis for bulk deletion and so on. So yes, have problems to think calmly, search for keywords ...

MyBatis Bulk Delete error code 1064, SQL state 42000;

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.