To add a database to a Java project

1. Add code to create database (similar to SQL statement) Add init schema.sql database syntax creation file to test resource file 2. Adding database in POM file depends on MySQL connector Java and mybatis spring boot starter <!--Add database dependency--> <dependency> <groupId>mysql</groupId> ...

Posted by sergio-pro on Thu, 30 Apr 2020 10:00:21 -0700

Spring Boot Aspect Aop thought

Spring Boot Aop Scope of Aspect Comment writing of interception rules Writing configuration file Aopconfig The compilation of add operation of comment interception Operation writing of add intercepted by method The writing of logAspect facet Writing of Main Operation results Scope of Aspect In o ...

Posted by rocky on Wed, 29 Apr 2020 21:17:19 -0700

Spring boot log Foundation

Springboot configuration log configuration file location logging.config: classpath:logging/logback.yml Spring boot log classification log4j: an open source log component implemented by apache logback: it is also designed by the author of log4j. It has better features. It is a log framework used to replace log4j and is the native implementation ...

Posted by aris1234 on Tue, 28 Apr 2020 19:41:38 -0700

Spring Boot + Spring Security for automatic login

Automatic login is a very common function in software development. For example, we log in to QQ email: Many websites will see similar options when we log in. After all, it's a very troublesome thing to let users enter their user name and password. The automatic login function is that after the user logs in successfully, if the user closes the ...

Posted by mentalist on Tue, 28 Apr 2020 19:02:09 -0700

High concurrency scenario - Request merging uncover HystrixCollapser - asynchronous implementation with Queue and thread pool

background In the high concurrency scenario of the Internet, there will be a lot of requests, but the database connection pool is relatively small, or the CPU pressure and processing logic need to be reduced. It is necessary to change a single query to batch query multiple and return. For example, in Alipay, query "personal information&quo ...

Posted by joebudden on Tue, 28 Apr 2020 00:59:13 -0700

Several ways to register Spring Bean

All roads lead to dragons and horses Premise: please https://blog.csdn.net/dong19891210/article/details/105697175 In case of Spring bean s can be registered in the following ways: 1. Register through GenericBeanDefinition Example code: Message helper class public class Message { private String message; public String getMessage() { retu ...

Posted by mahaguru on Mon, 27 Apr 2020 21:21:30 -0700

13. Spring cloud Alibaba Chapter 13, upgrade, service registration and configuration center Nacos

Spring cloud Alibaba Chapter 12, upgrade, service registration and configuration center Nacos 1, Why spring cloud Alibaba 1. Why With the micro service framework of spring cloud, why do you want to use the framework of spring cloud alibaba? The most important reason is spring Almost all components in the cloud use Netflix products, and ...

Posted by Liz_SA on Mon, 27 Apr 2020 20:09:31 -0700

Introduction to the use of Redis--Jedis

1. Create project 1.1 creation steps 1.2 add pom dependency <dependencies> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version> </dependency> <!--test--> <dep ...

Posted by premracer on Mon, 27 Apr 2020 07:14:31 -0700

How Spring solves bean circular dependency from source code

1 what is bean circular dependency circular reference is the original text of circular dependency, which refers to the mutual reference of multiple objects to form a closed loop. Take the circular dependency of two objects as an example: There are three cases of circular dependency in Spring: The cyclic dependence of the constructor; Circular ...

Posted by scotthoff on Sun, 26 Apr 2020 19:48:31 -0700

Spring boot series elegant handling of unified exception handling and unified result return

Spring boot series (x) unified exception handling and unified result return Previous recommendation Spring boot series (I) idea new spring boot project Introduction to SpringBoot series (2) Spring boot series (3) configuration file details Spring boot series (IV) detailed explanation of web static resource configuration Spring boot series (V) M ...

Posted by countcet on Sun, 26 Apr 2020 06:25:32 -0700