์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
- Swift
- xlsx-streamer
- ์ ์์๋ช ๊ธฐ๋ฅ๊ตฌํ
- Xcode
- poi ๋์ฉ๋
- ๋์ฉ๋์์ ์ ๋ก๋
- xssfworkbook
- jxls
- ์ ์์๋ช ๊ฐ๋ฐ
- monitorjbl
- ๋ฌ๋ ฅ๊ธฐ๋ฅ๊ฐ๋ฐ
- poi monitorjbl
- MSsql
- spring annotation
- swift ๋ฉ๋ชจ์ฅ ๋ง๋ค๊ธฐ
- monitorjbl ์์
- js๋ฌ๋ ฅ
- Oracle
- ios app ๊ฐ๋ฐ
- fullcalendar js
- js ์ ์์๋ช
- outofmemoryerror ๋ฐฉ์ง
- opcpackage
- PostgreSQL
- xssreader
- xcode12.5.1
- swift ๊ณ์ฐ๊ธฐ
- jxls ์์
- xcode swift memo
- mysql
- Today
- Total
web developer๐ฉ๐ป๐ป
POI monitorjbl xlsx-streamer ๋ฉ๋ชจ๋ฆฌ ์ด์ ํด๊ฒฐ ๋ณธ๋ฌธ
POI SAX ๋ณด๋ค ๋ ๊ฐ๋จํ๊ฒ ๋ฉ๋ชจ๋ฆฌ ์ด์๋ฅผ ํด๊ฒฐํ ์์๋ ๋ฐฉ๋ฒ
* ์๋์ monitorjbl api๋ฅผ ์ฌ์ฉํ๋ฉด ์์ ๋์ฉ๋ ๋ฌธ์ ๊ฐ ๊ฐ๋จํ๊ฒ ํด๊ฒฐ๋๋ค.
POI SAX XSSFReader ๋์ฉ๋ ์์ ํ์ผ ์ฝ๊ธฐ OOME(Out of Memory Error) ๋ฐฉ์ง
* ์ผ๋จ ์์ ์ ์ ๋์ฉ๋ ํ ์คํธ๋ฅผ ์ํ eclipse Heap ์์ญ ๋๋ฆฌ๊ธฐeclipse .ini ํ์ผ์ ์ด๊ธฐ Xms (์์ํฌ๊ธฐ) / Xmx (์ต๋ํฌ๊ธฐ) ์์ ํ๊ธฐ ์ฐธ๊ณ ๋ก Xmx ์ต๋ํฌ๊ธฐ๋ ์๊ธฐ์ pc ram ์ฌ์์ ํ์ธํ๊ณ ๋ฐ๊พธ๊ธฐ ์ถ์ฒ
truecode-95.tistory.com
1. poi๋ฒ์ ์ ๋ง๋ monitorjbl .jar๋ฅผ ๋ค์ด๋ฐ๊ธฐ.
Download xlsx-streamer.jar - @com.monitorjbl
Download: xlsx-streamer.jar (com.monitorjbl) - Streaming Excel reader JAR file - Latest & All Versions
mavenlibs.com
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.13</version> <!-- ์ต์ ๋ฒ์ ํ์ธ ํ์ -->
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.13</version> <!-- ์ต์ ๋ฒ์ ํ์ธ ํ์ -->
</dependency>
<!-- https://mvnrepository.com/artifact/com.monitorjbl/xlsx-streamer -->
<dependency>
<groupId>com.monitorjbl</groupId>
<artifactId>xlsx-streamer</artifactId>
<version>1.0.0</version>
</dependency>
2. monitorjbl api github ์์ค ํ์ธ
monitorjbl
monitorjbl.github.io
@ResponseBody
@RequestMapping(value = "/excelUploadServlet.do", method = RequestMethod.POST)
public void excelUploadServlet(MultipartHttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
try {
MultipartFile filePart = request.getFile("excelFile");
try (InputStream is = filePart.getInputStream()) {
Workbook workbook = (Workbook) StreamingReader.builder()
.rowCacheSize(100) // ๋ฉ๋ชจ๋ฆฌ์ ๋ณด๊ดํ ํ์ ์๋ฅผ ์ค์
.bufferSize(4096) // InputStream์ ํ์ผ๋ก ์ฝ์ ๋ ์ฌ์ฉํ ๋ฒํผ ํฌ๊ธฐ๋ฅผ ์ค์
.open(is); // InputStream์ผ๋ก๋ถํฐ StreamingReader ์ด๊ธฐํ
for (int s = 0; s < workbook.getNumberOfSheets(); s++) {
Sheet sheet = workbook.getSheetAt(s);
for (Row row : sheet) {
for (Cell cell : row) {
} // ๋ก์ง ์ถ๊ฐ
}
}
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
}
apache poi ๋ฉ๋ชจ๋ฆฌ ์ด์ํด๊ฒฐ
apache poi(XSSFWorkbook API) ๊ฐ ๊ฐ๊ณ ์๋ ๋ฉ๋ชจ๋ฆฌ ์ด์๋ก ์ธํด full gc๊ฐ ์ง์์ ์ผ๋ก ๋ฐ์ํ ์ ์๋ค์ด๋ฅผ ๊ทผ๋ณธ์ ์ผ๋ก ํด๊ฒฐํ๊ธฐ ์ํด์๋ read ์์ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ ์ฆ๋๊ฐ ๋ฐ์๋์ง ์๋๋ก ๊ฐ์ ๋ ๋ฌด์ธ๊ฐ๊ฐ
iamreo.tistory.com