spring boot excel讀取生成

2021-10-12 10:35:31 字數 2214 閱讀 3386

* excel 讀取

** @throws ioexception

*/@test

void

readexcel()

throws ioexception

//設定單元格值得型別

row.

getcell

(columnnum)

.setcelltype

(celltype.string)

; rowlist.

add(row.

getcell

(columnnum)

.getstringcellvalue()

);// 獲取單元格 取值

// system.out.print(row.getcell(columnnum).getstringcellvalue() + " ");

}//獲取當前系統時間

calendar calendar= calendar.

getinstance()

; ******dateformat dateformat=

new******dateformat

("yyyy年mm月dd日 hh時mm分ss秒");

rowlist.

add(

2,dateformat.

format

(calendar.

gettime()

)); rowslist.

add(rowlist)

; system.out.

println

(rowlist.

tostring()

);}// system.out.println(rowslist.tostring());

//excel 生成

createexcel

(rowslist)

;//關流

sheets.

close()

; stream.

close()

;}

/**

* excel 生成

** @throws ioexception

*/void

createexcel

(arraylist

> rowslist)

throws ioexception

} calendar calendar= calendar.

getinstance()

; ******dateformat dateformat=

new******dateformat

("yyyy-mm-dd");

//設定 路徑

file file =

newfile

("d:\\workspace\\訂單資訊表"

+dateformat.

format

(calendar.

gettime()

)+".xlsx");

fileoutputstream stream =

newfileoutputstream

(file)

; system.out.

println

("excel 生成成功");

// 需要拋異常

workbook.

write

(stream)

;//關流

stream.

close()

;}

君生我未生,我生君已老

君生我未生,我生君已老。君恨我生遲,我恨君生早。恨不生同時,日日與君好。我生君未生,君生我已老。我離君天涯,君隔我海角。我生君未生,君生我已老。化蝶去尋花,夜夜棲芳草。我不知道我是以何種感情把這詩看下去的。只是在看的時候想起你,然後莫名流淚。故事還要從那個炎熱的五月說起,從那個充滿紙醉金迷的上海說起...

君生我未生 我生君已老

你在歡笑,體會童年的快樂的時候,我還沒出現,準確的說,我爸和我媽剛好上 你拿著課本認真學習的時候,我剛剛來到這個世界上,剛剛學會啼哭.看見你曾經的舊照,覺得我們的時代感拉遠了不少,也就幾年而已,感覺你比我多過了幾個世紀。嘴角上揚的時候,是你最帥的樣子,我忍不住想多看你幾眼,又害怕被你發現,又害怕別人...

既生 Redis 何生 LevelDB ?

了解 redis 的同學都知道它是乙個純記憶體的資料庫,憑藉優秀的併發和易用性打下了網際網路項的半壁江山。redis 之所以高效能是因為它的純記憶體訪問特性,而這也成了它致命的弱點 記憶體的成本太高。所以在絕大多數場合,它比較適合用來做快取,長期不被訪問的冷資料被淘汰掉,只有熱的資料快取在記憶體中,...