This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12927|Reply: 0

[Source] Spring boot mybatis druid connection pool configuration

[Copy link]
Posted on 1/22/2019 10:57:46 AM | | | |
I see many articles on the Internet about Spring Boot configuring the druid connection pool, many of which are wrong, and,Many people don't know that they are misconfigured

Because whether it is configured correctly or misconfigured, the database can be added, deleted, modified and checked, and many people think that it can be used and configured correctly...

My server MySQL version: 5.5.20, and I don't know if it needs to be corresponded to the Java package, it seems that there is no problem with using the latest version of the mysql driver package.

pom.xml main configurations are as follows:



application.yml configuration:

DruidDBConfig.java configuration is as follows:

MySqlDataSourceConfig.java code is as follows:

AccountMapper.java code is as follows:

Controller Code:

Access Interface Address:http://127.0.0.1:8079/api/test/getAccount



Normal JSON data can be returned, as shown in the image above.

Visit the druid monitoring page:http://127.0.0.1:8079/druid/index.html



You can see data sources, SQL monitoring, and other information, as shown in the figure above.

(End)




Previous:【Stand-alone Sharing】No Man's Man v1.0.1 version
Next:MX Player Pro v1.10.31 Google Play
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com