This is a simple Spring Boot application demonstrating how to use Spring Data JPA to interact with a database.
There are no REST endpoints — all operations happen in the main() method.
- Creates a
Studentobject - Sets its properties (
name,rollno) - Uses
StudentRepoto:- Delete a student by ID
- (Optionally) Save a student to the database
- Spring Boot
- Spring Data JPA
- PostgreSQL (or any JPA-supported database)
- Java
git clone https://github.com/your-username/spring-jpa-demo.git
cd spring-jpa-demospring.datasource.url=jdbc:postgresql://localhost:5432/your_database
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true