Apache Commons DbUtils integrates Spring framework to realize simple CRUD

Commons DbUtils is an open source tool class library provided by Apache, which can simply encapsulate JDBC and simplify the development of JDBC. Commons DbUtils is very convenient to integrate the Spring Framework, which is relatively lightweight. It is very convenient to execute SQL statements (especially query statements). It can replace the ...

Posted by mrman23 on Tue, 29 Oct 2019 08:47:31 -0700

Mybaits source code analysis ---- create SqlSessionFactory according to the Configuration file (Configuration creation process)

We use mybatis to operate the database through the API call of SqlSession, and create SqlSession through SqlSessionFactory. Let's take a look at the creation process of SqlSessionFactory. Profile resolution portal Let's look at the test method in the first article 1 public static void main(String[] args) throws IOException { 2 Strin ...

Posted by rommel_toledo on Sun, 27 Oct 2019 23:53:57 -0700

Basic steps and code of Mybatis framework

Basic steps and code of Mybatis framework 1.ji create the required database 2. Configure the global configuration file mybatis ﹤ config.xml (other file names are preferred) <?xml version="1.0" encoding="UTF-8"?> ...

Posted by petrosa on Thu, 24 Oct 2019 07:01:50 -0700

A problem with 250W views on Stack Overflow: your object is lost

When browsing Stack Overflow, I found that the most popular problem is: what is NullPointerException (java.lang.NullPointerException), what causes it, and whether there is a good way or tool to track the cause of it? I didn't expect to see as many as 2.5 million views of this problem! So, I think it's time to sort out the best answers and share ...

Posted by maybl8r03 on Sun, 20 Oct 2019 19:43:41 -0700

Using HIkariCP in spring MVC project

What is HIkariCP https://www.jianshu.com/p/15b... Using HikariCP data sources pom.xml <dependency> <groupId>com.zaxxer</groupId> <artifactId>HikariCP</artifactId> <version>3.3.1</version> </dependency> Spring-mvc.xml <bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy ...

Posted by tomas.srna on Thu, 17 Oct 2019 12:08:19 -0700

Dynamic configuration of data source based on spring boot and AOP

Spring boot + AOP mode for multi data source switching Overall design idea: spring boot + AOP mode realizes multi data source switching, inherits AbstractRoutingDataSource to achieve dynamic data source acquisition, and uses annotation to specify data source in service layer. I. multi data source configuration In application.properties, our ...

Posted by the_Igel on Wed, 16 Oct 2019 23:06:57 -0700

Transaction management in ORACLE

Because of the work requirements, a large amount of data needs to be inserted into ORACLE data, and then the manual management of transaction opening is selected to insert a large amount of data. However, a pit is encountered here. Before the transaction management of mysql was opened to insert data, copying mysql is a bit impractical. Only 299 ...

Posted by philvia on Wed, 16 Oct 2019 14:35:28 -0700

It's enough for MyBatis to explain in detail

Chapter 1 details of MyBatis framework configuration file 1.1 typeHandlers type converter Whenever MyBatis sets the parameter to PreparedStatement or gets the value from the ResultSet result set, TypeHandler is used to handle the conversion between database type and java type. The following table describes the default TypeHandlers 1.1.1 c ...

Posted by vahidi on Tue, 15 Oct 2019 17:43:17 -0700

Spring Boot + Sharing-JDBC Read-Write Separation

This paper uses Sharding-JDBC to realize read-write separation based on entOS 7 + MySQL 5.7 I. MySQL Installation and Configuration 1.1 installation Execute orders in turn: sudo wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm sudo yum -y install mysql57-community-release-el7-10.noarch.rpm sudo yum ...

Posted by dagee on Mon, 14 Oct 2019 08:53:24 -0700

Starting Spring: Using Spring JDBC to manipulate databases

In previous blogs in this series, we have never explained how to operate databases, but in practical work, almost all systems are inseparable from data persistence, so it is very important to master how to operate databases. There are many ways to operate databases in Spring. We can use JDBC, Hibernate, MyBatis or other data persistence framewo ...

Posted by kippi on Sun, 13 Oct 2019 18:45:33 -0700