Mybatis generates execution statements through JDBC data driver
Most of our programming process uses excellent ORM frameworks, such as mybatis, hibernate and spring JDBC, but these are inseparable from the support of data-driven JDBC. Although it is very convenient to use, it is really difficult to encounter some problems, such as the problem that I haven't slept well all night. JDBC generates execution data. Let's take a look at the details.
Usually, we use the mybatis framework to operate relational databases, which is basically crud operation. At present, the company uses SQLSERVER database, but I have a problem when updating. The details are as follows:
mapper. XML content:
The test code is as follows:
Just update the driver's name according to the job number, but the SQL statements detected by SQL Server monitoring are generally as follows:
Of course, here I want to post my database connection string:
The implementation plan at this time can be seen as follows:
http://www.jb51.net/article/90264.htm
You can see that it is slow, but by slightly modifying the connection string:
Then execute the test code, and you can see
The execution speed of batch update has been significantly improved. For why and the advantages and disadvantages of the change, please see the following official website documents
https://technet.microsoft.com/zh-cn/library/ms378857%28SQL.90%29.aspx
https://technet.microsoft.com/zh-cn/library/ms378988%28v=sql.90%29.aspx
http://d.hatena.ne.jp/gnarl/20110706/1309945379
The above is the execution statement generated by mybatis through JDBC data driver introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!