Giter Site home page Giter Site logo

santteegt / spring-boot-pooling-tutorial Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 11 KB

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

License: Apache License 2.0

Java 100.00%
java-8 spring-boot hikaricp tomcat dbcp-pool spring maven

spring-boot-pooling-tutorial's Introduction

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

spring-boot-pooling-tutorial's People

Contributors

santteegt avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.