Accessing Data with Spring Data JPA and MySQL


implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 
runtimeOnly 'mysql:mysql-connector-java'

Configuring Database Connection Properties

# MySQL connection properties 
spring.jpa.hibernate.ddl-auto=update spring.datasource.url=jdbc:mysql://localhost:3306/rest-service spring.datasource.username=root

Create User Model Class

Create a Repository

Create Request File

Create User Controller

Run the Application

java -jar target/rest-service-0.0.1-SNAPSHOT.jar
java -jar build/libs/rest-service-0.0.1-SNAPSHOT.jar




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store