java 创建excel 文件错误:数据可能丢失
源代码如下,用poi3.5publicbooleannewWorkbook(StringurlName){Workbookwb=newHSSFWorkbook();try...
源代码如下,用poi3.5
public boolean newWorkbook(String urlName){
Workbook wb=new HSSFWorkbook();
try {
FileOutputStream fileOut=new FileOutputStream(urlName);
wb.write(fileOut);
fileOut.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
return true;
} 展开
public boolean newWorkbook(String urlName){
Workbook wb=new HSSFWorkbook();
try {
FileOutputStream fileOut=new FileOutputStream(urlName);
wb.write(fileOut);
fileOut.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
return true;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询