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
https://youtu.be/yX2w-Sof95s
Watch my new Hello spring boot series
https://youtu.be/F_rGkDeihBg?si=AvqLgRVvytkhy8lq
Watch Spring boot Hot topics
https://youtu.be/CUQWZHjuq-w
Java Interview / Question and Answer series
https://youtu.be/Y1uGGTrBYKw
Explain spring Bean Lifecycle
https://youtu.be/hUYGGqoXEPc
spring core
https://www.youtube.com/watch?v=r2Q0Jzl2qMQ&list=PL3NrzZBjk6m-nYX072dSaGfyCJ59Q5TEi
spring mvc
https://www.youtube.com/watch?v=zCHrZdJODg4&list=PL3NrzZBjk6m-OSeL3DRMD_ISa0u-9c1l1
spring mvc intermediate
https://www.youtube.com/watch?v=40YaLHbrwrY&list=PL3NrzZBjk6m_2jw8sC0BkEwSPFHxgQDWr
Spring JDBC
https://www.youtube.com/watch?v=5j_vh1b9dV8&list=PL3NrzZBjk6m-rYTKze-5Y5RvU8eykal4j
spring live project
https://www.youtube.com/watch?v=m_b_FwDjAXM&list=PL3NrzZBjk6m-9CVPueDLLermojwtfuW_f
SPRING SECURITY COURSE[NEW]
https://youtu.be/NMNLozLGT1s
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 seleniumexpress@gmail.com
you can ping me on my Facebook page
https://www.facebook.com/seleniumexpress
Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"
https://www.facebook.com/groups/187000222361579/
you can ask for support in my website forum
https://www.seleniumexpress.com
Subscribe to my youtube channel
https://www.youtube.com/channel/UCpUYkSDJpHug-vfC5S-NXRA?sub_confirmation=1
Follow me on Insta
https://www.instagram.com/selenium_express/