Use hikari connection pool for password decryption
This article mainly explains "using hikari connection pool for password decryption". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the idea of Xiaobian and study and learn "using hikari connection pool for password decryption" together.
The idea is to create a new class that inherits from HikariDataSource (similar to other data connection pools), then rewrite the getPassWord method, call the super.getPassword() of the parent class to get the configured value, and then decrypt and return
public class XXXDataSource extends HikariDataSource {
@Override
public String getPassword(){
String psw = super.getPassword();
return PasswordUtil.decValue(pws);//decryption tool writes itself
}
}
application.yml file
spring:
datasource:
jdbcUrl: jdbc:mysql://127.0.0.1:3306/jby? serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: 'f687101570bae7ce4d313c2b4440f4ae'
type:com.xxx.XXXDataSource #Own inheritance class
Thank you for reading, the above is the content of "using hikari connection pool for password decryption". After studying this article, I believe everyone has a deeper understanding of the problem of using hikari connection pool for password decryption. The specific use situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!