MyBatis integrates dual data sources

Sometimes in a project, there are situations where you need to connect two databases. This article will talk about how to use dual data sources (or multiple data sources) in combination with Spring and Mybatis. Background introduction The key to implementing multiple data sources in this article is the AbstractRoutingDataSource provided by Spri ...

Posted on Thu, 04 Jun 2020 11:09:39 -0700 by smallflower

When using limit paging query, do delete operation, which will result in data loss

Catalog When using limit paging query, do delete operation, which will result in data loss 1, Prepare data 1.1 mysql data script 1.2 code Two, validation 1. All data before verification 2. Data on the first page 3. Delete records 4. Add record 5. Data on the second page 6. Data after verification 7. log Three. Conclusion Four, suggesti ...

Posted on Wed, 15 Apr 2020 09:18:15 -0700 by roadkillguy

Use of Druid connection pool

Druid introduction Druid is Alibaba's open-source database connection pool. As a rising star, Druid has higher performance than dbcp and c3p0, and is used more and more widely.     druid benefits High performance. The performance is much higher than dbcp and c3p0. As long as it is a database supported by jdbc, Druid supports it and has good su ...

Posted on Sun, 29 Mar 2020 07:58:17 -0700 by gowni

ali druid filters log4j is not configured properly, which leads to disorderly printing of bugs executing SQL logs

Druid version: <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.6</version> </dependency> The project uses spring boot + jpa + druid, and LOG is logback. druid does not print SQL content befor ...

Posted on Fri, 20 Mar 2020 07:54:14 -0700 by linuxdoniv

Getting Started with Druid 0.17 - Data Access Guide

In the quick start, we demonstrated how to access local sample data, but Druid actually supports very rich data access methods.Such as batch data access and real-time streaming data access.In this paper, we will introduce these data access methods. File Data Access: Loading batch data from a file Accessing stream data from Kafka: Loading st ...

Posted on Mon, 16 Mar 2020 19:16:01 -0700 by shavas

Java language -- user login case

Case: user login User login case requirements: 1. Write two input boxes of login.html login page username & password 2. use the Druid database connection pool technology to operate the user table in the mysql and day14 databases 3. Using JdbcTemplate technology to encapsulate JDBC 4. Log in succ ...

Posted on Tue, 11 Feb 2020 08:50:12 -0800 by Supernovas

Xuecheng Online - day 15 - handout - media management system integration IV

3. Online learning interface3.1 demand analysisAccording to the business process below, this chapter completes the front-end learning page to request the learning service to obtain the course video address, and automatically plays the video. 3.2 build development environment3.2.1 create databaseCreat ...

Posted on Fri, 07 Feb 2020 07:37:38 -0800 by if

Druid Connection Pool for Nine SpringBoot 2 Database Access

Why use a database connection pool Do not use database connection pools: For sites with high concurrency, this can cause the following problems: Every web request establishes a database connection, reusing system resources in the same steps Unable to control the number of connection objects created, sy ...

Posted on Sun, 26 Jan 2020 17:23:07 -0800 by heepofajeep

The way of learning jdbc (3)

There are several problems 1) The existence of hard coding (username and password, url and classnameDriver) will be changed at any time 2) Just load the class file once, and load the file every time 3) The connection object needs to be created every time it queries, which is a waste of resources 4) Close resource code is lo ...

Posted on Sun, 05 Jan 2020 21:41:27 -0800 by badboy1245

spring+mybatis? Multi data source configuration

Master and slave data source configuration Data source configuration of sub database and sub table Using dynamic data source and AOP to realize sub database 1. Configure multiple data sources in the application.yml file spring: http: encoding: charset: UTF-8 jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 ...

Posted on Thu, 19 Dec 2019 07:17:53 -0800 by my800stuff