Spring Boot JDBC
Spring Boot provides starter and libraries for connecting to our application with JDBC. Here, we are creating an application which connects with Mysql database. It includes the following steps to create and setup JDBC with Spring Boot.
Create a database
Create a table in to mysql
Creating a Spring Boot Pproject
Providing project name and other project related information.
After finishing, create following files in your project.
Configure database into application.properties file.
Creating a controller to handle HTTP requests.
Run the application
Run SpringBootJdbcApplication.java file as Java application.
Now, open browser and follow the following URL.
It says data has inserted successfully. let?s confirm it by checking mysql table.
Well, our application is working fine. Now, we can perform other database operations as well.