Spring Boot does not support hikari keepaliveTime configuration - spring-boot

Can you please let us know how can I can pass keepaliveTime config to Hikari in spring boot 2.1.12

There seems to be setter called setKeepaliveTime on the DataSource objectsee docs
There is an article on how to configure datasource configurations specifically for sping boot here

Related

Do i need c3p0 for Springboot 2.x?

I am migrating a existing Spring application (non Spring boot) to Springboot 2.x. I see there is a c3p0.properties file with following configuration: com.mchange.v2.c3p0.management.ExcludeIdentityToken=true. What does this does exactly? Do I need this if I am using Springboot 2.x? Or do I need to setup something else configuration in my application.properties file?
Thank you for help.
Spring Boot 2.x use HikariCp as a default JDBC connection pool. It is faster then c3p0.
You should use Hikari.
You can read about it compared with c2p0:
Hikari vs other CPs
Spring Boot will autoconfig it to you, but you can customize it (for example in application.properties)
For the com.mchange.v2.c3p0.management.ExcludeIdentityToken visit the documentation page's Jmx configuration section
JMX configuration

Spring boot, spring data jpa application - how to check which connection pool being used?

How to check what is the connection pool being used by default. I am using Spring boot version 1.5.4.RELEASE
UPDATE : https://www.mkyong.com/spring-boot/spring-boot-how-to-know-which-connection-pool-is-used/
Spring Boot uses HikariCP as the default connection pool, due to its remarkable performance and enterprise-ready features.
Here’s how Spring Boot automatically configures a connection pool datasource:
Spring Boot will look for HikariCP on the classpath and use it by
default when present
If HikariCP is not found on the classpath, then Spring Boot will pick
up the Tomcat JDBC Connection Pool, if it’s available
If neither of these options is available, Spring Boot will choose
Apache Commons DBCP2, if that is available
Source: https://www.baeldung.com/spring-boot-tomcat-connection-pool

How to Refresh Spring Boot Configuration Info with Using Spring Cloud Config

I would like to ask how to refresh spring boot configuration info with using spring cloud config. Would you please give me some advice? Many thanks.
If your spring boot application is a client of Spring Cloud Configuration Server and use itself as single point of truth in the application configuration let's say retrieve application.properties/yml from the config server, you can benefit of #RefreshScope. in this case if you do a post to the /refresh if you use spring boot 1.x or /actuator/refresh if you use spring boot 2.x all the bean that are have are annotated as #RefreshScope will be refreshed.

how to encrypt application.properties in spring boot

Spring use application.properties as the configure file, and I have created a new app which all working good exception the spring.database.password which does not meet the security requirement in my company. Is there any ways to encryt the psw? is there any example for me?
You could use jasypt to handle the encryption and then use Jasypt's Spring integration or this Jasypt Spring Boot Starter to wire it into Spring.

spring boot jndi lookup datasource for WAS liberty

Hi Can any one please direct me to the example where I need to do jndi lookup for datasource in WAS liberty server. I need to do this using spring boot.
Or I don't understand your question or it is really obvious:
spring.datasource.jndi-name=DS_JNDI_NAME
You should place that to your application.properties
See the Spring Boot docs:
http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
and
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html#boot-features-connecting-to-a-jndi-datasource

Resources