공부 (@Deprecated)

java.lang.IllegalStateException: Cannot get a STRING value from a NUMERIC cell 에러 해결 출처: https://code-lab1.tistory.com/406 [코드 연구소:티스토리]

가비로그 2024. 8. 27. 04:38
728x90
반응형

https://code-lab1.tistory.com/406

 

java.lang.IllegalStateException: Cannot get a STRING value from a NUMERIC cell 에러 해결

에러 상황 Spring에서 Apache POI를 통해 엑셀 파일을 읽으려고 했다. 그런데 연도(year) 셀을 읽을 때 cannot get a STRING value from a numeric cell 라는 에러가 발생했다. 해당 에러는 숫자가 입력된 셀에서 Strin

code-lab1.tistory.com

row.getCell(1).setCellType(CellType.String);
year = row.getCell(1).getStringCellValue();

출처: https://code-lab1.tistory.com/406 [코드 연구소:티스토리]

728x90
반응형