Skip to content

Small project showing how to setup a Connection Pool in a Spring Boot project

License

Notifications You must be signed in to change notification settings

santteegt/spring-boot-pooling-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Pooling Connections Tutorial

Getting started project showing how to setup one of the recommended Connection Pool libraries by the Spring Boot reference doc.

Installation requirements

In order to build and execute this project, you need the following requirements:

  • Java SDK 8
  • Maven 3.x
  • Docker Compose (Optional)

Database configuration

The project setup a connection prool to consume data from a PostgreSQL database. In order to perform a fast execution of this sample project, you can setup a docker image by running the following commands:

~ $ cd spring-boot-pooling-tutorial
~ $ docker-componse up postgresql

Connection pool setup

The project includes required libraries to setup the following Connection Pool implementations;

  • HikariCP (Default setup) (See conf parameters here)
  • Tomcat JDBC (See conf parameters here)
  • DBCP2 (See conf parameters here)

If you want to configure a Connection pool different from the default, please uncomment the related dependencies in the pom.xml

Parameter configuration

If you wish to experiment more with the parameter configuration of a connection pool implementation, you can modify the application.properties file.

Build and execution

$ mvn package
$ java -jar target/spring-boot-pooling-tutorial-1.0-SNAPSHOT.jar

About

Small project showing how to setup a Connection Pool in a Spring Boot project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages