Spring Boot Download CSV file from Database example

A CSV (comma-separated values) file is a plain text file that contains data which format is described in RFC4180. Each row has a number of fields, separated by commas. Each line should contain the same number of fields throughout the file. In this tutorial, I will show you how to build Spring Boot download CSV file Rest API example that exports data from MySQL Database table using & Apache Commons CSV.

Related Posts:
Spring Boot: Upload & Read CSV file into MySQL Database | Multipart File
Spring Boot Multipart File upload example
How to upload multiple files in Java Spring Boot

Excel file instead: Spring Boot: Download Excel file example

Deployment:
Deploy Spring Boot App on AWS – Elastic Beanstalk
Docker Compose: Spring Boot and MySQL example

Read More

@DataJpaTest example for Spring Data Repository Unit Test

Nowadays Unit Test is so important in Software Development, and Spring Framework also provides @DataJpaTest annotation to make writing test for JPA Repository more simpler. In this tutorial, we’re gonna look at how to apply @DataJpaTest in our Spring Boot Project with TestEntityManager, then run with JUnit 5.

This tutorial gives you an additional unit test for the Post:
Spring Boot, Spring Data JPA: CRUD example

More Practice:
Spring Boot – test Rest Controller with @WebMvcTest
JPA Repository query example in Spring Boot
Spring Boot Token based Authentication with Spring Security example
Spring Boot @ControllerAdvice & @ExceptionHandler example
– Documentation: Spring Boot Swagger 3 example
– Caching: Spring Boot Redis Cache example
– Validation: Spring Boot Validate Request Body

Associations:
Spring Boot One To One example with JPA, Hibernate
Spring Boot One To Many example with JPA, Hibernate
Spring Boot Many to Many example with JPA, Hibernate

Read More