This project is a Spring Boot application that demonstrates CRUD (Create, Read, Update, Delete) operations with PostgreSQL as the database and implements global exception handling.
- Create, Read, Update, Delete operations for an entity (e.g.,
Employee
) - PostgreSQL as the database
- Global exception handling with custom error responses
- RESTful API with Spring Boot
- Maven build
- Spring Boot 3.x
- Spring Data JPA
- PostgreSQL
- Maven
- Java 17
- Lombok (optional for reducing boilerplate code)
- Java 17 or higher
- PostgreSQL
- Maven
- Postman or cURL (for testing API)
git clone https://github.com/hasanuzzaman-dev/spring-postgres-crud.git
cd spring-postgres-crud
Ensure PostgreSQL is installed and running. Create a new database and update the application.properties file with your database credentials:
# src/main/resources/application.yml
spring:
application:
name: spring-postgres-crud
datasource:
url: jdbc:postgresql://localhost:5432/spring-postgres-crud
username: postgres
password: postgres
jpa:
hibernate:
ddl-auto: update
mvn clean install
mvn spring-boot:run
### Instructions
- Replace the GitHub repository URL with your actual repository.
- Adjust the package names, project-specific details, and paths as per your project structure.
- You may also add additional sections such as deployment instructions if needed.