Showing posts with the label Connection Pooling

Configuring Tomcat Connection pool and Hikari Connection pool in Spring Boot Application

One key component of spring boot starter dependencies is spring-boot-starter-data-JPA. This allows us to use JPA and work with production databases by using some popular JDBC connection pooling implementations, such as HikariCP or Tomcat JDBC Connection Pool. Tomcat Connection Pooling Spring Boot will look for HikariCP on the classpath and use it by default when present. To configure a Tomcat JDBC connection pool instead of the default HikariCP, we'll exclude HikariCP from the spring-boot-starter-data-JPA dependency and add the tomcat-JDBC Maven dependency. Maven (pom.xml) <dependency> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-starter-data-jpa </artifactId> <exclusions> <exclusion> <groupId> com.zaxxer </groupId> <artifactId> HikariCP </artifactId> </exclusion> </exclusions> </dependency> <dependency> &