Skip to content

An example of how to connect to multiple databases with a Spring Boot application.

Notifications You must be signed in to change notification settings

keramiozsoy/spring-boot-multiple-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-multiple-db

An example of how to connect to multiple databases with a Spring Boot application.

Technologies

  • springboot
  • java17
  • mssql
  • postgres

Prepare Databases

docker run --name=multiple-db-postgres --env=POSTGRES_PASSWORD=WQqps58o1rt6DrUpJsw2s --env=POSTGRES_USER=postgres -p 5432:5432 -d postgres:12-alpine
docker run --name=multiple-db-mssql --env=MSSQL_SA_PASSWORD=WQqps58o1rt6DrUpJsw2 --env=ACCEPT_EULA=Y -p 1433:1433 --restart=no -d mcr.microsoft.com/mssql/server:2022-latest

Send Request

Test insert data to mssql

curl http://localhost:9090/mssql

Test insert data to postgres

curl http://localhost:9090/postgres

Releases

No releases published

Packages

No packages published

Languages