I am making a spring boot application which will take the excel file and store its content and store it in database. I have tried many ways..but not successful. Is anyone has id
Finally found the solution.
Html file for uploading the form is
Controller class is
@PostMapping("/import")
public void mapReapExcelDatatoDB(@RequestParam("file") MultipartFile reapExcelDataFile) throws IOException {
List tempStudentList = new ArrayList();
XSSFWorkbook workbook = new XSSFWorkbook(reapExcelDataFile.getInputStream());
XSSFSheet worksheet = workbook.getSheetAt(0);
for(int i=1;i
Make sure to add the dependecy
org.apache.poi
poi
3.12
org.apache.poi
poi-ooxml
3.12
Now it will work fine.