Created
February 10, 2019 14:45
-
-
Save riyenas0925/c721fe2be466f9b8bf8bd5bd29cbe849 to your computer and use it in GitHub Desktop.
excel upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GetMapping("uploadResult") | |
public void uploadResult(Integer trackNo,Integer univNo, String savedName , Model model)throws Exception{ | |
List<subjectVO> list =new ArrayList<subjectVO>(); | |
FileInputStream file = new FileInputStream(uploadPath + "\\" + savedName); | |
HSSFWorkbook workbook = new HSSFWorkbook(file); | |
HSSFSheet sheet = workbook.getSheetAt(0); | |
for(int rowindex = 0; rowindex < sheet.getPhysicalNumberOfRows(); rowindex++){ | |
if(rowindex != 0){ | |
HSSFRow row = sheet.getRow(rowindex); | |
subjectVO vo = new subjectVO(); | |
vo.setCourseNum(row.getCell(2).getStringCellValue()); | |
vo.setCourseTitle(row.getCell(3).getStringCellValue()); | |
vo.setCompletionType(row.getCell(4).getStringCellValue()); | |
list.add(vo); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment