Spring Boot || Tutorial 8 || Create a complete CRUD Project using Spring Boot, JPA and MYSQL(Physical RDBMS) - NESTED CODE || TECH FLOAT

Breaking

Post Top Ad

Post Top Ad

Wednesday, 20 June 2018

Spring Boot || Tutorial 8 || Create a complete CRUD Project using Spring Boot, JPA and MYSQL(Physical RDBMS)

Last tutorial we have seen how to do CRUD operation. Now we will do the same thing but using MYSQL db and JPA connectivity. Lets follow the below steps-

Step-1: Make sure you have downloaded MySQL database and installed it in your machine. You should be able to launch MySQL WorkBench successfully. Refer the below screen. Please let us know if you are facing any issues to install the below DB.


Step-2: Now we need to create the project and do environment set up. You may follow the same step as explained in Tutorial 6 (click here). Only make sure when you are choosing db select MySQL as DB instead of Apache Derby. Refer below screen -


Step-3: Once you are all good with new project set up edit application.property with below lines-
(Basically all DB related set up)

spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/sys?useSSL=false
spring.datasource.username=root
spring.datasource.password=Password123
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

Also copy the code written in previous blog (click here). Entire project structure should look like below image -



Step-4: Now you can execute the project and test with same test cases as explained in previous tutorial. As we have used MYSQL - you can be able to see physical table from MYSQL db as shown in below image -


Please let us know you feedback. Also if you need any help mention that in comment box. Happy Reading!!

No comments:

Post a Comment

Post Bottom Ad