How Spring JDBC Auto configuration works internally ?🤔 Spring Boot Foundation tutorial | MySQL

Опубликовано: 02 Октябрь 2024
на канале: Selenium Express
6,272
274

Ever thought ? how spring boot connects to database ? How Spring JDBC Auto configuration works internally ? How Spring auto configures the jdbc template and datasource ? This is one of the import concept which will build your Spring Boot Foundation. In this tutorial, We will be learning this topic with a practical approach which will prepare us for the spring boot Interview as well.

To execute any sql statements over a database , first we need a connection object. The Datasource component takes connection creation responsibility which is later used by JdbcTemplate under the hood to connect to any database like MySQL before executing any SQL queries.

If the DataSource and JdbcTemplate object creation has not done by the Developer , Spring boot does it by using its autoconfiguraiton feature. The components like DataSourceAutoConfiguration and JdbcTemplateAutoConfiguration does this work under the hood.

In this video we have used different classes to create connection object which will be used by the framework under the hood. We have used DriverManager Datasource , Hikari connection pool, C3p0 connection pool , DBCP connection pooling example as well.

A connection pool helps in creating a number of connections during the server bootstrap itself which is used by the framework before invoking any sql queries over the database. This helps in performance optimisation. Using the connection pool, a same connection can be reused numbers of time and helps in reducing connection creation time for each db operation. Hikari is used as a default Connection Pool in spring boot.

Let’s learn how spring boot configures all these internally through autoconfiguration, if not set by the developer.

Timestamp
------------------

00:00:00 - A Question on Spring Boot Auto configuration
00:03:29 - Spring Boot and JDBC API Integration
00:18:26 - What is a Datasource ?
00:23:30 - JdbcTemplate configuration
00:28:33 - DriverManagerDatasource and it’s drawback
00:37:53 - What is a Connection Pool ?
00:45:56 - Spring Boot + Connection Pool (c3p0) implementation
00:53:20 - How Spring Boot JDBC Autoconfiguration works internally?
01:04:36 - DataSourceAutoConfiguration and
JDBCTemplateAutoConfiguration

#springboot #springboottutorial
#springbootinterviewquestions

For more free/paid courses visit
https://www.seleniumexpress.com

LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers
   • Java interview questions and answers ...  

Watch my new Hello spring boot series
   • Spring Vs Spring Boot - Why Spring Bo...  

Watch Spring boot Hot topics
   • @Reposicotry Vs @Service | Spring Boo...  

Java Interview / Question and Answer series
   • Java collections interview questions ...  

Explain spring Bean Lifecycle
   • REAL-TIME: Spring Bean life cycle usi...  

spring core
   • Spring framework tutorial for beginne...  

spring mvc
   • Spring MVC course introduction || Und...  

spring mvc intermediate
   • [INTERMEDIATE] Spring MVC Course Prev...  

Spring JDBC
   • Spring JDBC Course Preview || Let’s t...  

spring live project
   • #1 Build and Deploy A Spring Project ...  

SPRING SECURITY COURSE[NEW]
   • Spring Security Course Preview | Lear...  

For more courses visit
https://www.seleniumexpress.com

Any time you are getting stuck with issues, Feel free to ask for support.
You can send mail to [email protected]

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
https://www.seleniumexpress.com

Subscribe to my youtube channel

   / @seleniumexpress  

Follow me on Insta
  / selenium_express