SpringBoot integrated Druid connection pool

1. Data sourceData source is a JDBC specification interface defined by SUN company for obtaining database connectionIt is located in the javax.sql package and is used to obtain the connection instead of the driver managerpackage javax.sql; import java.sql.Connection; import java.sql.SQLException; import java.sql.Wrapper; // Omit comments publi ...

Posted on Tue, 30 Nov 2021 17:05:41 -0500 by ray-solomon

SpringBoot data source injection principle

1. SpringBoot data source injection principleWe know that after spring.datasource is configured in application.yaml, the data source can be injected, but why?spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useU ...

Posted on Tue, 30 Nov 2021 16:23:08 -0500 by todd-imc

The monitoring stat of the Druid connection pool caused a memory leak

Alibaba's Druid connection pool can monitor sql. However, the monitoring information will be stored in memory, which will cause memory leakage in some scenarios. 1. Causes When an online machine gives an alarm (high heap memory utilization), log in to the server and dump the heap for analysis: image.png Discovery: sqlStatMap comparison ...

Posted on Tue, 30 Nov 2021 02:11:15 -0500 by bjdouros

Detailed explanation of alibaba druid database connection pool

1. Introduction Druid connection pool is an open source database connection pool project of Alibaba. Druid connection pool is born for monitoring. It has built-in powerful monitoring function. The monitoring feature does not affect the performance. Powerful, can prevent SQL injection, and built-in login can diagnose Hack application behavior ...

Posted on Thu, 18 Nov 2021 06:01:32 -0500 by harishkumar09

Dynamic update of JAVA static constant non @ Value annotation based on NACOS and JAVA reflection mechanism

1. Preface Constant class files are used in projects. If the values need to be changed, the code needs to be resubmitted, or the @ Value annotation is used to realize dynamic refresh. If there are too many constants, it is also very troublesome. Can there be a simpler way to implement them? This article describes the way that a JAVA class cor ...

Posted on Thu, 18 Jun 2020 22:05:31 -0400 by Frame

druid monitor configuration -- springBoot project

Cause: one day, my colleague's project connection pool burst At first, I thought there was a long-running sql, but after checking the DB, I found that there was no such sql at all Then I wonder if it is the calling of the third-party interface, which is suspended or not closed due to timeout. After ...

Posted on Fri, 12 Jun 2020 03:30:17 -0400 by ashbai

Spring boot08: integrating Druid

Crazy God said that the spring boot series is easy to understand. Based on the version 2.2.5 of spring boot, you are welcome to forward and pay attention to learning. WeChat official account: Bilibili, the first of the gods, Java No reprint without authorization of the author Integrated Druid About Druid A large part of Java progr ...

Posted on Tue, 26 May 2020 00:58:17 -0400 by davelr459

Getting Started with Druid 0.17 - A Complete Data Query Style

This article describes how Druid queries data. First, we ensure that the data has been loaded successfully. Druid queries are based on HTTP, and Druid provides a query view and formats the results. Druid provides three query modes, SQL, native JSON, CURL. 1. SQL Query Let's use wiki's data as an example Query the top 10 page edits SELECT page, ...

Posted on Thu, 14 May 2020 22:59:14 -0400 by amorphous

Spring Boot default data source

1. Use the Spring Boot default data source http://blog.csdn.net/qq_35760213/article/details/73863252 1.1 introducing POM dependency In pom files, we directly rely on the official spring boot start JDBC module or spring boot start data JPA module. <dependency> <groupId>org.springframework.boot</groupId> < ...

Posted on Sun, 03 May 2020 05:14:25 -0400 by Mijii

Data source management | PostgreSQL environment integration, JSON type application

Source code: GitHub point here || GitEE point here 1, Introduction to PostgreSQL 1. Comparison with MySQL PostgreSQL is a powerful and open-source relational database system. There are a lot of comparative analysis between PostgreSQL and MySQL on the Internet. Mostly from the performance, open source protocol, SQL standards, development diffic ...

Posted on Sat, 25 Apr 2020 22:03:05 -0400 by SurgeProto