Spring Data JPA [PRO] - How to connect Multiple Databases using Spring Boot | Multiple Datasources

  Рет қаралды 12,724

Selenium Express

Selenium Express

Күн бұрын

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

Пікірлер: 61
@iampradeephr
@iampradeephr 2 ай бұрын
One of the best in depth explanations ever 🔥
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
Thank you 😊
@Bindas_Raja
@Bindas_Raja Ай бұрын
Bhai bahut badhia lagila au easy explanation. . Thanks from ODISHA ❤
@AnkitLadha-fo8em
@AnkitLadha-fo8em 2 ай бұрын
Appreciate your hard work and explaining meaning of the error messages at every step.
@ujjwalpandey4721
@ujjwalpandey4721 Ай бұрын
You are amazing... Not other word category suits you... You are incredible.
@biswajeetsahoochintu2329
@biswajeetsahoochintu2329 2 ай бұрын
Best depth concept you explained abhilash Jay jaganath abhilash
@virupakshak4746
@virupakshak4746 2 ай бұрын
Superb... Thanks, Abhilash for nicely explained it....
@harleyseixas8708
@harleyseixas8708 Ай бұрын
Excelente conteúdo, muito bem explicado. Step by step...💯💯💯💯 Obrigado por compartilhar seu conhecimento.
@jesuslovesyou8664
@jesuslovesyou8664 Ай бұрын
Extraordinary teaching thank u soo much for clear explanation . Keep giving more videos like this
@msvchalapathy
@msvchalapathy 2 ай бұрын
Fabulous topic. Thank you for this session
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
My pleasure 😊
@maharishi1
@maharishi1 Ай бұрын
Thank you Abhilash...
@srinivasulumannem4137
@srinivasulumannem4137 Ай бұрын
Hi @Abhilash iam looking for kafka video series from your side .have been following you for the last 3 years on words .I have covered all your videos .
@jaafarhamza3402
@jaafarhamza3402 Ай бұрын
2nd half done. Thank you
@priyanshu4016
@priyanshu4016 Ай бұрын
absolutely great video . i am learning a lot from your videos , thanks for sharing
@user-kn4dc2ek5z
@user-kn4dc2ek5z Ай бұрын
Thanks Abhi🤝❤. as always you explained well
@shirokuma145
@shirokuma145 Ай бұрын
1st Half Done, your explanations are very engaging and clear 😎
@shirokuma145
@shirokuma145 Ай бұрын
2nd Half Done, many thanks for the tutorial!
@srinivasn7991
@srinivasn7991 2 ай бұрын
Clear understandng each and everthing
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
Thank you so much, Srinivasan ❤️
@gowtham4383
@gowtham4383 Күн бұрын
Thanks bro .
@arpansrivastava7537
@arpansrivastava7537 29 күн бұрын
Very nice 👍👍
@pranjitmedhi6764
@pranjitmedhi6764 Ай бұрын
great work
@srigakolapuatchuthasai6638
@srigakolapuatchuthasai6638 2 ай бұрын
Thanks Abhi ❤
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
❤️
@mohammedirfan5744
@mohammedirfan5744 2 ай бұрын
Thanks sir
@saruth
@saruth 2 ай бұрын
you are best!
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
@rahulbhatanagar6175
@rahulbhatanagar6175 Ай бұрын
1st half done 👍
@priyanshu4016
@priyanshu4016 Ай бұрын
first half done 👍
@pothinenivenkat
@pothinenivenkat Ай бұрын
ధన్యవాదాలు!
@AbhishekAnandDas
@AbhishekAnandDas 2 ай бұрын
I have used the same methods to connect to two databases in one of the production application I'm currently working on... 😊
@sarathchandra941
@sarathchandra941 2 ай бұрын
1st half done
@edgarangelveradelrio3645
@edgarangelveradelrio3645 Ай бұрын
Hi, excellent video! I Have a question, in spring boot 3 what is the alternative to ChainedTransactionManager?
@pavankumar-mt3gm
@pavankumar-mt3gm Ай бұрын
on multi datasource implementation in springboot I get Field ConfigurationRepository in ConfigurationService required a bean named 'entityManagerFactory' that could not be found.
@sahukarinaveenkumar3188
@sahukarinaveenkumar3188 Ай бұрын
Hi Ahbishek sir, can u please make one video on oauth internal? Like how resource server communicates with auth server internal classes and concepts?
@kalaimaranmadhavan4182
@kalaimaranmadhavan4182 Ай бұрын
Please make video for multitenant application with seperate schema. I am waiting for your video. I have searched in youtubes no videos related on this and i cannot understand those videos. Please make
@ritunjaykumar5428
@ritunjaykumar5428 Ай бұрын
Hi, How can we manage the multiple transaction at the same time. suppose i am inserting data in Mysql DB but unable to insert in PG Db. then how to rollback for both....
@user-ze5rc9eb8m
@user-ze5rc9eb8m Ай бұрын
Hi i want to connect two postgres database when both the postgres databases are up and running only primary database has to get and post the data secondary should be stand by when primary database goes down secondary database has to take over when primary database come back ideally primary should take over how can we achieve this as of now i have configured 2 postgres but both the postgres are able to get and post the data
@balakrishna9437
@balakrishna9437 2 ай бұрын
Great video, 🎉 one question can’t we write a single configuration file for each of the product and order entities?
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
Thank you Bala, Yes we can! But better to create one per db as we can keep things relevant to a specific db.
@ophemtech
@ophemtech Ай бұрын
Hi Abhilash, thank you so much for this video. though i learnt this myself the hard way but your video really made me understand each blocks of code and why they even need to be written. but please there is still a problem i am trying to solve, how do i make it possible to make table name come from properties file like you use @ConfigurationProperties(). i want to make it possible that users of my product can specify the table name so my entity can just model the table directly other than me changing the code. for example any authentication database would have username , password, email columns, but they can be given diffreent names like auth_table, user_table, etc. so i want people to be able to specify that table name dynamically by themselves, more like for a saas product kind of thing. is it possible?
@in_tyler_we_trust
@in_tyler_we_trust 2 ай бұрын
Sir Spring boot for beginners playlist is complete ? If not please please complete it so that we move on to the difficult topics Thank you!
@debiprasaddash654
@debiprasaddash654 2 ай бұрын
Getting java job as a fresher is very difficult now a days 😢😢
@teklehaimanotatikilt1435
@teklehaimanotatikilt1435 Ай бұрын
abhi how can we integrate fingerprint with spring security?by the way your videos are very helful
@dipeshvishwakarma5671
@dipeshvishwakarma5671 Ай бұрын
Hi this owsm video Thanks so much!! One request: could you please make one video on spark data connection, reading data from parquet file from AWS S3 using spark.sql("") It would be greatly appreciated and very helpful. Thanks
@premraj.m
@premraj.m 2 ай бұрын
47:30 keypoint
@mdnishat9560
@mdnishat9560 2 ай бұрын
Bro please complete the playlist of word guess game🤗🤗
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
Tomorrow you will get a new episode 🙂
@PradeepKumar-sx6ms
@PradeepKumar-sx6ms 2 ай бұрын
If I give challenges you like to crack???
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
I can try 😀
@PradeepKumar-sx6ms
@PradeepKumar-sx6ms 2 ай бұрын
@@SeleniumExpress share your personal email id
@vlarunrajesh
@vlarunrajesh Ай бұрын
Bro. you are complicating simple things and make video lengthier.. keep it as simple.
@punitvishwakarma718
@punitvishwakarma718 Ай бұрын
Bhai accent kyo badal raha Indian accent acha nahi lgta hai kya??? Banavati lagta hai
@kunwarrajneeshsingh3132
@kunwarrajneeshsingh3132 Ай бұрын
2nd half done
@ayushsingh2431
@ayushsingh2431 2 ай бұрын
Getting error- Parameter 0 of method mySQLEntityManagerFactoryBean in org.ayushsingh.springdatamulitsoruce.config.MySQLEntityManagerConfiguration required a bean of type 'org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder' that could not be found.
@SeleniumExpress
@SeleniumExpress 2 ай бұрын
Hi Ayush ! Make one of your datasource as Primary.
@arpitrajput6424
@arpitrajput6424 Ай бұрын
@@SeleniumExpress didn't work for me , now getting error related to mySqlTransactionalManager
@arpitrajput6424
@arpitrajput6424 Ай бұрын
Parameter 0 of method mySqlTransactionalManager in com.example.SPringbootJpa.config.MySQLJPAConfiguration required a bean of type 'org.springframework.orm.jpa.LocalEntityManagerFactoryBean' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Qualifier("mySqlEntityManagerFactoryBean")
Microservices in 60 mins | Learning Path & Interview Preparation
59:40
Selenium Express
Рет қаралды 17 М.
The Noodle Picture Secret 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 30 МЛН
MEGA BOXES ARE BACK!!!
08:53
Brawl Stars
Рет қаралды 25 МЛН
🍕Пиццерия FNAF в реальной жизни #shorts
00:41
🔥 Spring Boot With Multiple Databases in Hindi
50:32
Learn Code With Durgesh
Рет қаралды 27 М.
Apache KAFKA Tutorial | KAFKA Crash Course | Spring Boot
56:49
Daily Code Buffer
Рет қаралды 66 М.
Bootiful Spring Boot 3.x by Josh Long @ Spring I/O 2024
54:26
Spring I/O
Рет қаралды 16 М.
The Noodle Picture Secret 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 30 МЛН