91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3KB
    文件類(lèi)型: .rar
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-06-17
  • 語(yǔ)言: Java
  • 標(biāo)簽: 源碼??工具??

資源簡(jiǎn)介

NULL 博文鏈接:https://minsifansi.iteye.com/blog/693292

資源截圖

代碼片段和文件信息

package?com.wanmy.dbTools;

import?java.io.File;
import?java.io.FileInputStream;
import?java.io.InputStream;
import?jxl.Sheet;
import?jxl.Workbook;

import?com.wanmy.domain.Product;
import?com.wanmy.service.impl.ProductServiceImpl;

public?class?Batch_InputProduct?{

public?boolean?addProductFromExcel(String?path)?{

Workbook?wb?=?null;
InputStream?ins=null;
Product?product=null;
boolean?ff=false;
try?{
//?構(gòu)建Workbook對(duì)象?只讀Workbook對(duì)象
//?直接從本地文件創(chuàng)建Workbook
//?從輸入流創(chuàng)建Workbook
//?將Excel文件URL流化
ins?=?new?FileInputStream(new?File(path));
//?得到工作薄
wb?=?Workbook.getWorkbook(ins);
//?Sheet(術(shù)語(yǔ):工作表)就是Excel表格左下角的Sheet1Sheet2Sheet3但在程序中
//?Sheet的下標(biāo)是從0開(kāi)始
//?獲取第一張Sheet表
Sheet?st?=?wb.getSheet(0);
//?獲取Sheet表中所包含的總列數(shù)
//int?stCols?=?st.getColumns();
//?獲取Sheet表中所包含的總行數(shù)
int?stRows?=?st.getRows();
//?獲取指定單元格的對(duì)象引用
//?st.getCell(列行);
//?如第一行為屬性項(xiàng)則從第二行開(kāi)始取數(shù)據(jù)
for?(int?i?=?1;?i? String?name=st.getCell(0?i).getContents();
String?detail_desc=st.getCell(1i).getContents();
String?keywords=st.getCell(2i).getContents();
String?search_keywords=st.getCell(3i).getContents();
String?search_title=st.getCell(4i).getContents();
String?search_description=st.getCell(5i).getContents();
String?flag=st.getCell(6i).getContents();
String?hot=st.getCell(7i).getContents();
String?code=st.getCell(8i).getContents();
String?sale_st_date=st.getCell(9i).getContents();
String?sale_en_date=st.getCell(10i).getContents();
String?income_st_date=st.getCell(11i).getContents();
String?income_en_date=st.getCell(12i).getContents();
String?anticipate_income=st.getCell(13i).getContents();
String?income_account=st.getCell(14i).getContents();
product=new?Product();
if(flag!=null){
product.setFlag(Integer.parseInt(flag.trim()));
}
if(hot!=null){
product.setHot(Integer.parseInt(hot.trim()));
}
product.setName(name);
product.setAnticipate_income(anticipate_income);
product.setAdd_date(new?IPTimeStamp().getDate());
product.setCode(code);
product.setDetail_desc(detail_desc);
product.setIncome_account(income_account);
product.setIncome_en_date(income_en_date);
product.setIncome_st_date(income_st_date);
product.setSearch_title(search_title);
product.setSearch_keywords(search_keywords);
product.setSearch_description(search_description);
product.setSale_en_date(sale_en_date);
product.setSale_st_date(sale_st_date);
product.setKeywords(keywords);
new?ProductServiceImpl().addProduct(product);
ff=true;
}
}?catch?(Exception?e)?{
e.printStackTrace();
}finally{
wb.close();
}
return?ff;
}
}

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----

?????文件???????2874??2010-06-17?15:19??excel\batch_input.jsp

?????文件???????2929??2010-06-17?14:48??excel\Batch_InputProduct.java

?????文件????????655??2010-06-17?15:25??excel\batch_input_ok.jsp

?????目錄??????????0??2010-06-17?17:55??excel

-----------?---------??----------?-----??----

?????????????????6458????????????????????4


評(píng)論

共有 條評(píng)論

相關(guān)資源