I generate mapper interface and xml file in my application. There is no exception in method signature. But when the sql execute failed MyBatis will throw an exception. I found the exception thrown from MyBatis is always PersistenceException. After reading the source code, I seemed to understand.
In this page I will show you how to add border CSS in table. It is better add border in table before adjusting width and height. Example is here
Do not know which to use when you want set or change the content of selector in JQuery? I will show you the difference between text(), html() and val() in this page. Example is here, copy it and save as html file. Click different button will change different selector's content.
Recently I met Chinese garbled(中文乱码) problem in MySQL. Solve this problem by changing the character. In this page I will show you how to change character in MySQL. Before changing it we need to know the support character sets in MySQL.
Use db.collection.update to update the document. Do not know how to update document you can click Update document in MongoDB. In this page I will show you how to update document which field is null or not exists.
Use db.collection.count() to count the number of documents. You can add a query filter to count the specific documents. Examples are here.
StringUtils in apache-common-lang3 framework is an useful class. You can use removeEnd to remove the last character or characters. If you want remove the character and ignore the case use removeEndIngoreCase instead.
We use db.collection.update() to update the document. Since version 3.2 you can use db.collection.updateOne() ,db.collection.updateMany() or db.collection.replaceOne() to update document or documents. Click here for more detail. In this page I will show you simple examples.
When I use SpringMVC and tomcat to develop the project I often meet garbled problem. In this page I will show you the right way to use them. The most important thing is making the "input" and "output" encoding same.
Mybatis is a light weight Java persistence framework(compared with Hibernate). You have to write a lot of mapper xml files and mapper interfaces. These things are duplicate works, we can generate them by IDEA Mybatis plugin. In this page I will show you how to use this plugin to generate xml mapper file and mapper interface.
In this page I will show you how to use scheduling tasks with Spring Boot. As we all known there is no config file in Spring Boot. We use annotations to config scheduling tasks. This example also works well in Spring.
If the output or a text file is not too long we can know how many lines. But sometimes the output is to long to show them in one screen. At this point you need wc command to count the numbers of output lines. For example there are many log files like following.
MongoTemplate can help you CURD documents in MongoDB easily. In this page I will show you how to use it. I would recommend you to learn Mongo tutorial first, if you are unfamiliar with commends in MongoDB. For quick start I use Spring Boot to test MongoTemplate.