According to the Spring Boot Doc, we are suggested using Tomcat pooling datasource. If I want to deploy my Spring Boot application as a war file to a standard Tomcat server. How to config the pooling datasource? How to make Spring using the datasource which standard Tomcat provided?
Do a standard JNDI lookup and expose the resulting DataSource as a Bean (either via XML or Java Config).
The pooled data source can then be setup any way you like in a element in Tomcat's context.xml
Related
We have a Spring Boot application that we need to deploy to a JBOSS server. We have a requirement to keep all configuration in the JBOSS standalone.xml file. I need to get SSL set up on the Spring Boot application, but every guide I find shows how to add it to application.properties. How can I tell the Spring Boot application to use the SSL configuration from the JBOSS standalone.xml file?
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
Does SpringBoot use JNDI for the data base connection (auto configuration) ?
Can you give sample use cases which requires JNDI implementation in Spring Boot Application ?
JNDI is very useful when the servlet container or the application server provides some resources to the application.
The usual example is the datasource. It is useful, because binding the datasource to the JNDI allows you to deploy the same application into different environments without changing any configuration file.
When multiple spring boot applications created and deployed to a tomcat server. Is it possible to use a common connection pooling, datasource instead of providing these details in application.properties file. Or does this already taken care within the spring boot implementation
When you deploy multiple application then each application manages it connection pool.
Spring boot boundary is limited to each application context and it does not know what other application deployed and which db they are using.
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