(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;