Рет қаралды 12,724
In this Spring Data JPA tutorial, we will learn, How to connect Multiple Databases using Spring Boot. We will be using a MySQL database and a Postgres database and create datasources for the same. As we will be creating multiple datasources for our application, We also need to set up multiple EntityManager for our application as well. Not only that, this tutorial covers setting up multiple transaction managers for our entity managers and helps you link them using @EnableJpaRepositories annotation. Mark that this is an important spring data jpa annotation as it helps creating the Repository implementation.
We will pull all the above together by creating a spring boot application which will continuously push data to multiple databases. You can use the same in your real-time project irrespective of the databases you are using. (Incase you have a h2 /d2/oracle/sql server db)
Timestamp
------
00:00:00 - Sprig Data Jpa - Video Insights
00:03:45 - Spring Data jpa project setup
00:05:45 - The goal - Connect with Multiple databases
00:08:05 - Creating Product Entity
00:11:37 - Spring Data Jpa CrudRepository
00:18:18 - DatasourceProperties : Component walkthrough
00:19:52 - Setting up mysql datasource using application.properties
00:28:09 - Customising datasource properties
00:32:24 - Postgres datasource properties configuration
00:38:24 - spring boot @ConfgurationProperties - use case 1
00:44:46 - @Configuration with @Bean - use case 2
00:49:40 - DriverManagerDatasource vs DatasourceProperties’s initalizeDatasourceBuilder
00:57:02 - Multiple datasources in action with @Primary
01:13:19 - Setting up multiple entity managers
01:26:49 - @EnableJpaRepoistories : tech walkthrough
01:43:12 - Setting up multiple jpa transaction managers (PlatformTransctionManger)
01:54:55 - Success: Multiple datasource in action
01:56:58 - Best practice - @EnableTransactionManager
01:57:37 - [Test] check in data to multiple database with a spring boot app
02:00:37 - Outro
#springboot #springdatajpa #jpa #hibernate
For more free/paid courses visit
www.seleniumexpress.com
LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers
• Java interview questio...
Watch my new Hello spring boot series
• Spring Vs Spring Boot ...
Watch Spring boot Hot topics
• @Reposicotry Vs @Servi...
Java Interview / Question and Answer series
• Java collections inter...
Explain spring Bean Lifecycle
• REAL-TIME: Spring Bean...
spring core
• Spring framework tutor...
spring mvc
• Spring MVC course intr...
spring mvc intermediate
• [INTERMEDIATE] Spring ...
Spring JDBC
• Spring JDBC Course Pre...
spring live project
• #1 Build and Deploy A ...
SPRING SECURITY COURSE[NEW]
• Spring Security Course...
For more courses visit
www.seleniumexpress.com
Any time you are getting stuck with issues, Feel free to ask for support.
You can send mail to seleniumexpress@gmail.com
you can ping me on my Facebook page
/ seleniumexpress
Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"
/ 187000222361579
you can ask for support in my website forum
www.seleniumexpress.com
Subscribe to my youtube channel
/ @seleniumexpress
Follow me on Insta
/ selenium_express