javajava文件的读取和写入大量Excel,怎么在这个方法上面进行扩展

Java实现批量导入excel表格数据到数据库中的方法
转载 &更新时间:日 10:00:01 & 作者:CharlinGod
这篇文章主要介绍了Java实现批量导入excel表格数据到数据库中的方法,结合实例形式详细分析了java导入Excel数据到数据库的具体步骤与相关操作技巧,需要的朋友可以参考下
本文实例讲述了Java实现批量导入excel表格数据到数据库中的方法。分享给大家供大家参考,具体如下:
1、创建导入抽象类
package com.gcloud.common.
import java.io.FileInputS
import java.io.FileNotFoundE
import java.io.IOE
import java.io.PrintS
import java.sql.SQLE
import java.util.ArrayL
import java.util.L
import org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder.SheetRecordCollectingL
import org.apache.poi.hssf.eventusermodel.FormatTrackingHSSFL
import org.apache.poi.hssf.eventusermodel.HSSFEventF
import org.apache.poi.hssf.eventusermodel.HSSFL
import org.apache.poi.hssf.eventusermodel.HSSFR
import org.apache.poi.hssf.eventusermodel.MissingRecordAwareHSSFL
import org.apache.poi.hssf.eventusermodel.dummyrecord.LastCellOfRowDummyR
import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingCellDummyR
import org.apache.poi.hssf.model.HSSFFormulaP
import org.apache.poi.hssf.record.BOFR
import org.apache.poi.hssf.record.BlankR
import org.apache.poi.hssf.record.BoolErrR
import org.apache.poi.hssf.record.BoundSheetR
import org.apache.poi.hssf.record.FormulaR
import org.apache.poi.hssf.record.LabelR
import org.apache.poi.hssf.record.LabelSSTR
import org.apache.poi.hssf.record.NoteR
import org.apache.poi.hssf.record.NumberR
import org.apache.poi.hssf.record.RKR
import org.apache.poi.hssf.record.R
import org.apache.poi.hssf.record.SSTR
import org.apache.poi.hssf.record.StringR
import org.apache.poi.hssf.usermodel.HSSFW
import org.apache.poi.poifs.filesystem.POIFSFileS
* 导入抽象类
* Created by charlin on .
public abstract class HxlsAbstract implements HSSFListener {
private int minC
private POIFSFileS
private PrintS
private int lastRowN
private int lastColumnN
/** Should we output the formula, or the value it has? */
private boolean outputFormulaValues =
/** For parsing Formulas */
private SheetRecordCollectingListener workbookBuildingL
private HSSFWorkbook stubW
// Records we pick up as we process
private SSTRecord sstR
private FormatTrackingHSSFListener formatL
/** So we known which sheet we're on */
private int sheetIndex = -1;
private BoundSheetRecord[] orderedBSRs;
@SuppressWarnings("unchecked")
private ArrayList boundSheetRecords = new ArrayList();
// For handling formulas with string results
private int nextR
private int nextC
private boolean outputNextStringR
private int curR
private List&String&
@SuppressWarnings( "unused")
private String sheetN
public HxlsAbstract(POIFSFileSystem fs)
throws SQLException {
this.output = System.
this.minColumns = -1;
this.curRow = 0;
this.rowlist = new ArrayList&String&();
public HxlsAbstract(String filename) throws IOException,
FileNotFoundException, SQLException {
this(new POIFSFileSystem(new FileInputStream(filename)));
//excel记录行操作方法,以行索引和行元素列表为参数,对一行元素进行操作,元素为String类型
// public abstract void optRows(int curRow, List&String& rowlist) throws SQLE
//excel记录行操作方法,以sheet索引,行索引和行元素列表为参数,对sheet的一行元素进行操作,元素为String类型
public abstract void optRows(int sheetIndex,int curRow, List&String& rowlist) throws E
* 遍历 excel 文件
public void process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
workbookBuildingListener = new SheetRecordCollectingListener(
formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
factory.processWorkbookEvents(request, fs);
* HSSFListener 监听方法,处理 Record
@SuppressWarnings("unchecked")
public void processRecord(Record record) {
int thisRow = -1;
int thisColumn = -1;
String thisStr =
String value =
switch (record.getSid()) {
case BoundSheetRecord.sid:
boundSheetRecords.add(record);
case BOFRecord.sid:
BOFRecord br = (BOFRecord)
//进入sheet
if (br.getType() == BOFRecord.TYPE_WORKSHEET) {
// Create sub workbook if required
if (workbookBuildingListener != null && stubWorkbook == null) {
stubWorkbook = workbookBuildingListener
.getStubHSSFWorkbook();
// Works by ordering the BSRs by the location of
// their BOFRecords, and then knowing that we
// process BOFRecords in byte offset order
sheetIndex++;
if (orderedBSRs == null) {
orderedBSRs = BoundSheetRecord
.orderByBofPosition(boundSheetRecords);
sheetName = orderedBSRs[sheetIndex].getSheetname();
case SSTRecord.sid:
sstRecord = (SSTRecord)
case BlankRecord.sid:
BlankRecord brec = (BlankRecord)
thisRow = brec.getRow();
thisColumn = brec.getColumn();
thisStr = "";
case BoolErrRecord.sid:
BoolErrRecord berec = (BoolErrRecord)
thisRow = berec.getRow();
thisColumn = berec.getColumn();
thisStr = "";
case FormulaRecord.sid:
FormulaRecord frec = (FormulaRecord)
thisRow = frec.getRow();
thisColumn = frec.getColumn();
if (outputFormulaValues) {
if (Double.isNaN(frec.getValue())) {
// Formula result is a string
// This is stored in the next record
outputNextStringRecord =
nextRow = frec.getRow();
nextColumn = frec.getColumn();
thisStr = formatListener.formatNumberDateCell(frec);
thisStr = '"' + HSSFFormulaParser.toFormulaString(stubWorkbook,
frec.getParsedExpression()) + '"';
case StringRecord.sid:
if (outputNextStringRecord) {
// String for formula
StringRecord srec = (StringRecord)
thisStr = srec.getString();
thisRow = nextR
thisColumn = nextC
outputNextStringRecord =
case LabelRecord.sid:
LabelRecord lrec = (LabelRecord)
curRow = thisRow = lrec.getRow();
thisColumn = lrec.getColumn();
value = lrec.getValue().trim();
value = value.equals("")?" ":
this.rowlist.add(thisColumn, value);
case LabelSSTRecord.sid:
LabelSSTRecord lsrec = (LabelSSTRecord)
curRow = thisRow = lsrec.getRow();
thisColumn = lsrec.getColumn();
if (sstRecord == null) {
rowlist.add(thisColumn, " ");
value = sstRecord
.getString(lsrec.getSSTIndex()).toString().trim();
value = value.equals("")?" ":
rowlist.add(thisColumn,value);
case NoteRecord.sid:
NoteRecord nrec = (NoteRecord)
thisRow = nrec.getRow();
thisColumn = nrec.getColumn();
// TODO: Find object to match nrec.getShapeId()
thisStr = '"' + "(TODO)" + '"';
case NumberRecord.sid:
NumberRecord numrec = (NumberRecord)
curRow = thisRow = numrec.getRow();
thisColumn = numrec.getColumn();
value = formatListener.formatNumberDateCell(numrec).trim();
value = value.equals("")?" ":
rowlist.add(thisColumn, value);
case RKRecord.sid:
RKRecord rkrec = (RKRecord)
thisRow = rkrec.getRow();
thisColumn = rkrec.getColumn();
thisStr = '"' + "(TODO)" + '"';
// 遇到新行的操作
if (thisRow != -1 && thisRow != lastRowNumber) {
lastColumnNumber = -1;
// 空值的操作
if (record instanceof MissingCellDummyRecord) {
MissingCellDummyRecord mc = (MissingCellDummyRecord)
curRow = thisRow = mc.getRow();
thisColumn = mc.getColumn();
rowlist.add(thisColumn," ");
// 如果遇到能打印的东西,在这里打印
if (thisStr != null) {
if (thisColumn & 0) {
output.print(',');
output.print(thisStr);
// 更新行和列的值
if (thisRow & -1)
lastRowNumber = thisR
if (thisColumn & -1)
lastColumnNumber = thisC
// 行结束时的操作
if (record instanceof LastCellOfRowDummyRecord) {
if (minColumns & 0) {
// 列值重新置空
if (lastColumnNumber == -1) {
lastColumnNumber = 0;
// 行结束时, 调用 optRows() 方法
lastColumnNumber = -1;
optRows(sheetIndex,curRow, rowlist);
} catch (Exception e) {
e.printStackTrace();
rowlist.clear();
2、创建导入接口
package com.gcloud.common.
import java.util.L
public interface HxlsOptRowsInterface {
public static final String SUCCESS="success";
* 处理excel文件每行数据方法
* @param sheetIndex
* @param curRow
* @param rowlist
* @return success:成功,否则为失败原因
* @throws Exception
public String optRows(int sheetIndex, int curRow, List&String& rowlist) throws E
3、创建实现类, 在这个方法实现把导入的数据添加到数据库中
package com.gcloud.common.
import java.util.L
public class HxlsInterfaceImpl implements HxlsOptRowsInterface {
public String optRows(int sheetIndex, int curRow, List&String& datalist)
throws Exception {
//在这里执行数据的插入
//System.out.println(rowlist);
//saveData(datalist);
return "";
4、导入工具实现
package com.gcloud.common.
import java.io.FileNotFoundE
import java.io.IOE
import java.sql.SQLE
import java.util.ArrayL
import java.util.L
* excel导入工具
* Created by charlin on .
public class ExcelImportUtil extends HxlsAbstract{
//数据处理bean
private HxlsOptRowsInterface hxlsOptRowsI
//处理数据总数
private int optRows_sum = 0;
//处理数据成功数量
private int optRows_success = 0;
//处理数据失败数量
private int optRows_failure = 0;
//excel表格每列标题
private List&String&
//失败数据
private List&List&String&&
//失败原因
private List&String&
//要处理数据所在的sheet索引,从0开始
private int sheetI
public ExcelImportUtil(String filename, int sheetIndex, HxlsOptRowsInterface hxlsOptRowsInterface) throws IOException,
FileNotFoundException, SQLException {
super(filename);
this.sheetIndex = sheetI
this.hxlsOptRowsInterface = hxlsOptRowsI
this.rowtitle = new ArrayList&String&();
this.failrows = new ArrayList&List&String&&();
this.failmsgs = new ArrayList&String&();
public void optRows(int sheetIndex,int curRow, List&String& rowlist) throws Exception {
/*for (int i = 0 ;i& rowlist.size();i++){
System.out.print("'"+rowlist.get(i)+"',");
System.out.println();*/
//将rowlist的长度补齐和标题一致
int k=rowtitle.size()-rowlist.size();
for(int i=0;i&k;i++){
rowlist.add(null);
if(sheetIndex == this.sheetIndex){
optRows_sum++;
if(curRow == 0){//记录标题
rowtitle.addAll(rowlist);
String result = hxlsOptRowsInterface.optRows(sheetIndex, curRow, rowlist);
if(!result.equals(hxlsOptRowsInterface.SUCCESS)){
optRows_failure++;
//失败数据
failrows.add(new ArrayList&String&(rowlist));
failmsgs.add(result);
optRows_success++;
public long getOptRows_sum() {
return optRows_
public void setOptRows_sum(int optRows_sum) {
this.optRows_sum = optRows_
public long getOptRows_success() {
return optRows_
public void setOptRows_success(int optRows_success) {
this.optRows_success = optRows_
public long getOptRows_failure() {
return optRows_
public void setOptRows_failure(int optRows_failure) {
this.optRows_failure = optRows_
public List&String& getRowtitle() {
public List&List&String&& getFailrows() {
public List&String& getFailmsgs() {
public void setFailmsgs(List&String& failmsgs) {
this.failmsgs =
5、导入实现方法:
public static void main(String[] args){
ExcelImportUtil importU
importUtil = new ExcelImportUtil("d:/data.xls",0, new HxlsInterfaceImpl());
importUtil.process();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
更多关于java相关内容感兴趣的读者可查看本站专题:《》、《》、《》、《》及《》
希望本文所述对大家java程序设计有所帮助。
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具java的poi技术下载Excel模板上传Excel读取Excel中内容(SSM框架)
使用到的jar包
JSP: client.jsp
&%@ page language="java" contentType="text/ charset=UTF-8"
pageEncoding="UTF-8"%&
&%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&
&!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&
String importMsg = "";
if (request.getSession().getAttribute("msg") != null) {
importMsg = request.getSession().getAttribute("msg").toString();
request.getSession().setAttribute("msg", "");
&title&批量导入客户&/title&
&meta http-equiv="Content-Type" content="text/ charset=UTF-8"&
&script src="${pageContext.request.contextPath}/js/jquery-1.11.0.min.js"&&/script&
&script type="text/javascript"&
function check() {
var excel_file = $("#excel_file").val();
if (excel_file == "" || excel_file.length == 0) {
alert("请选择文件路径!");
$(document).ready(function() {
var msg = "";
if ($("#importMsg").text() != null) {
msg = $("#importMsg").text();
if (msg != "") {
alert(msg);
&a href="download.htm?fileName=muban.xls"&下载Exel模板&/a&
&font color="bule"&批量导入客户&/font&
&form action="batchimport.htm" method="post" enctype="multipart/form-data" onsubmit="return check();"&
&div style="margin: 30"&
&input id="excel_file" type="file" name="filename" accept="xlsx" size="80" /&
&input id="excel_button" type="submit" value="导入Excel" /&
&font id="importMsg" color="red"&&%=importMsg%&&/font&&input type="hidden" /&
controller:&ClientController.java
package com.shiliu.game.
import java.io.F
import java.io.FileInputS
import java.io.FileNotFoundE
import java.io.IOE
import java.io.InputS
import java.io.OutputS
import java.util.L
import javax.servlet.http.HttpServletR
import javax.servlet.http.HttpServletR
import org.apache.commons.logging.L
import org.apache.commons.logging.LogF
import org.springframework.stereotype.C
import org.springframework.web.bind.annotation.RequestM
import org.springframework.web.bind.annotation.RequestM
import org.springframework.web.bind.annotation.RequestP
import org.springframework.web.multipart.MultipartF
import com.shiliu.game.domain.bean.C
import com.shiliu.game.utils.ReadE
import com.shiliu.game.utils.WDWU
* @author wkr
@Controller
@RequestMapping("/client")
public class ClientController {
private static Log log = LogFactory.getLog(ClientController.class);
* 访问controller进入操作页面
@RequestMapping(value="/init")
public String init(){
System.out.println("控制台输出:初始化页面信息");
return "client/client";
* 上传Excel,读取Excel中内容
* @param file
* @param request
* @param response
* @throws IOException
@RequestMapping(value = "/batchimport",method = RequestMethod.POST)
public String batchimport(@RequestParam(value="filename") MultipartFile file,
HttpServletRequest request,HttpServletResponse response) throws IOException{
log.info("ClientController ..batchimport() start");
String Msg =
boolean b =
//判断文件是否为空
if(file==null){
Msg ="文件是为空!";
request.getSession().setAttribute("msg",Msg);
return "client/client";
//获取文件名
String name=file.getOriginalFilename();
//进一步判断文件是否为空(即判断其大小是否为0或其名称是否为null)验证文件名是否合格
long size=file.getSize();
if(name==null || ("").equals(name) && size==0 && !WDWUtil.validateExcel(name)){
Msg ="文件格式不正确!请使用.xls或.xlsx后缀文档。";
request.getSession().setAttribute("msg",Msg);
return "client/client";
//创建处理EXCEL
ReadExcel readExcel=new ReadExcel();
//解析excel,获取客户信息集合。
List&Customer& customerList = readExcel.getExcelInfo(file);
if(customerList != null && !customerList.toString().equals("[]") && customerList.size()&=1){
//迭代添加客户信息(注:实际上这里也可以直接将customerList集合作为参数,在Mybatis的相应映射文件中使用foreach标签进行批量添加。)
for(Customer customer:customerList){
//这里可以做添加数据库的功能
System.out.println("第一个值:"+customer.getCustomer1()+"\t第二个值:"+customer.getCustomer2()+"\t第三个值:"+customer.getCustomer3());
Msg ="批量导入EXCEL成功!";
request.getSession().setAttribute("msg",Msg);
Msg ="批量导入EXCEL失败!";
request.getSession().setAttribute("msg",Msg);
return "client/client";
* 下载Excel模板
* @param fileName
* @param request
* @param response
@RequestMapping("/download")
public String download(String fileName, HttpServletRequest request,
HttpServletResponse response) {
System.out.println("控制台输出:走入下载");
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "fileName="+ fileName);
/*String path = Thread.currentThread().getContextClassLoader()
.getResource("").getPath()
+ "download";//这个download目录为啥建立在classes下的
String path="D:\\upload";
InputStream inputStream = new FileInputStream(new File(path+ File.separator + fileName));
OutputStream os = response.getOutputStream();
byte[] b = new byte[2048];
while ((length = inputStream.read(b)) & 0) {
os.write(b, 0, length);
// 这里主要关闭。
os.close();
inputStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
返回值要注意,要不然就出现下面这句错误!
//java+getOutputStream() has already been called for this response
utils:&WDWUtil.java
package com.shiliu.game.
* @author wkr
* 工具类验证Excel文档
public class WDWUtil {
* @描述:是否是2003的excel,返回true是2003
* @param filePath
public static boolean isExcel2003(String filePath)
return filePath.matches("^.+\\.(?i)(xls)$");
* @描述:是否是2007的excel,返回true是2007
* @param filePath
public static boolean isExcel2007(String filePath)
return filePath.matches("^.+\\.(?i)(xlsx)$");
* 验证是否是EXCEL文件
* @param filePath
public static boolean validateExcel(String filePath){
if (filePath == null || !(isExcel2003(filePath) || isExcel2007(filePath))){
utils:&ReadExcel.java
package com.shiliu.game.
import java.io.F
import java.io.FileInputS
import java.io.IOE
import java.util.ArrayL
import java.util.D
import java.util.L
import org.apache.poi.hssf.usermodel.HSSFW
import org.apache.poi.ss.usermodel.C
import org.apache.poi.ss.usermodel.R
import org.apache.poi.ss.usermodel.S
import org.apache.poi.ss.usermodel.W
import org.springframework.web.multipart.MultipartF
import org.springframework.web.multipart.commons.CommonsMultipartF
import com.shiliu.game.domain.bean.C
* @author wkr
* 工具类读取Excel类中内容
public class ReadExcel {
private int totalRows = 0;
private int totalCells = 0;
//错误信息接收器
private String errorM
//构造方法
public ReadExcel(){}
//获取总行数
public int getTotalRows()
{ return totalR}
//获取总列数
public int getTotalCells() {
return totalC}
//获取错误信息-暂时未用到暂时留着
public String getErrorInfo() { return errorM }
* 读EXCEL文件,获取客户信息集合
* @param fielName
public List&Customer& getExcelInfo(MultipartFile Mfile){
//把spring文件上传的MultipartFile转换成CommonsMultipartFile类型
CommonsMultipartFile cf= (CommonsMultipartFile)M //获取本地存储路径
File file = new
File("D:\\fileupload");
//创建一个目录 (它的路径名由当前 File 对象指定,包括任一必须的父路径。)
if (!file.exists()) file.mkdirs();
//新建一个文件
File file1 = new File("D:\\fileupload\\" + new Date().getTime() + ".xls");
//将上传的文件写入新建的文件中
cf.getFileItem().write(file1);
} catch (Exception e) {
e.printStackTrace();
//初始化客户信息的集合
List&Customer& customerList=new ArrayList&Customer&();
//初始化输入流
FileInputStream is =
Workbook wb =
//根据新建的文件实例化输入流
is = new FileInputStream(file1);
//根据excel里面的内容读取客户信息
//当excel是2003时
wb = new HSSFWorkbook(is);
//当excel是2007时
//wb = new XSSFWorkbook(is);
//读取Excel里面客户的信息
customerList=readExcelValue(wb);
is.close();
}catch(Exception e){
e.printStackTrace();
} finally{
if(is !=null)
is.close();
}catch(IOException e){
e.printStackTrace();
return customerL
* 读取Excel里面客户的信息
* @param wb
private List&Customer& readExcelValue(Workbook wb){
//得到第一个shell
Sheet sheet=wb.getSheetAt(0);
//得到Excel的行数
this.totalRows=sheet.getPhysicalNumberOfRows();
//得到Excel的列数(前提是有行数)
if(totalRows&=1 && sheet.getRow(0) != null){//判断行数大于一,并且第一行必须有标题(这里有bug若文件第一行没值就完了)
this.totalCells=sheet.getRow(0).getPhysicalNumberOfCells();
List&Customer& customerList=new ArrayList&Customer&();//声明一个对象集合
C//声明一个对象
//循环Excel行数,从第二行开始。标题不入库
for(int r=1;r&totalRr++){
Row row = sheet.getRow(r);
if (row == null)
customer = new Customer();
//循环Excel的列
for(int c = 0; c &this.totalC c++){
Cell cell = row.getCell(c);
if (null != cell){
customer.setCustomer1(getValue(cell));//得到行中第一个值
}else if(c==1){
customer.setCustomer2(getValue(cell));//得到行中第二个值
}else if(c==2){
customer.setCustomer3(getValue(cell));//得到行中第三个值
//添加对象到集合中
customerList.add(customer);
return customerL
* 得到Excel表中的值
* @param cell
Excel中的每一个格子
* @return Excel中每一个格子中的值
@SuppressWarnings({ "static-access", "unused" })
private String getValue(Cell cell) {
if (cell.getCellType() == cell.CELL_TYPE_BOOLEAN) {
// 返回布尔类型的值
return String.valueOf(cell.getBooleanCellValue());
} else if (cell.getCellType() == cell.CELL_TYPE_NUMERIC) {
// 返回数值类型的值
return String.valueOf(cell.getNumericCellValue());
// 返回字符串类型的值
return String.valueOf(cell.getStringCellValue());
entity:&Customer.java
package com.shiliu.game.domain.
* @author wkr
public class Customer {
private String Customer1;
private String Customer2;
private String Customer3;
public Customer() {
public Customer(Integer id, String customer1, String customer2,
String customer3) {
Customer1 = customer1;
Customer2 = customer2;
Customer3 = customer3;
public Integer getId() {
public void setId(Integer id) {
public String getCustomer1() {
return Customer1;
public void setCustomer1(String customer1) {
Customer1 = customer1;
public String getCustomer2() {
return Customer2;
public void setCustomer2(String customer2) {
Customer2 = customer2;
public String getCustomer3() {
return Customer3;
public void setCustomer3(String customer3) {
Customer3 = customer3;
效果页面:
在上一篇blog:java的poi技术读取Excel[10] 中介绍了关于java中的poi技术读取excel的相关操作 读取excel和MySQL相关: java的poi技术 ...
这篇blog是介绍java中的poi技术读取Excel数据,然后保存到MySQL数据中. 你也可以在 : java的poi技术读取和导入Excel了解到写入Excel的方法信息 使用JXL技术可以在
在这之前写过关于java读,写Excel的blog如下: Excel转Html java的poi技术读,写Excel[10] java的poi技术读取Excel[2003-20 ...
这篇blog主要是讲述java中poi读取excel,而excel的版本包括:和2010两个版本, 即excel的后缀名为:xls和xlsx. 读取excel和MySQL相关: ja ...
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
该功能实现了实现多文件上传在iOS开发中,喜欢的朋友可以研究一下吧. NSURL* url = [NSURL URLWithString:@&xxx&]; ASIFormDataR ...
一.废话 Excel表格是office软件中的一员,几乎是使用次数最多的办公软件.所以在java进行企业级应用开发的时候经常会用到对应的上传下载便利办公. 目前,比较常用的实现Java导入.导出Exc ...
项目结构: http://www.cnblogs.com/hongten/gallery/image/111987.html
用到的Excel文件: http://www.cnblogs.com/h ...
项目经理担责任.产品担责任.测试只需要把测试中发现的问题展示出来.如实反应问题.谁担责任谁有权利决定上不上线.所以他们直接绕过了测试.APP的上线让我学到了很多东西,见识了很多东西,也感悟了很多.这是 ...
1.证书管理 用Xcode8打开工程后,比较明显的就是下图了,这个是苹果的新特性,可以帮助我们自动管理证书.建议大家勾选这个Automatically manage signing(Ps.但是在bea ...
一.替换 1.把对应字符换成新的字符 比如&D:\java_learn&中的'\'换成‘\\’ String str = &D:\\java_learn\\JAVA学习\ ...
Source Address: http://masteringelectronicsdesign.com/the-non-inverting-amplifier-output-resistance/ ...
linux上进程有5种状态: 1. 运行(正在运行或在运行队列中等待) 2. 中断(休眠中, 受阻, 在等待某个条件的形成或接受到信号) 3. 不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有 ...
D. Robin Hood
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills a ...
在jquery中对于div样式操作我们会使用到CSS() removeClass() addClass()方法来操作了,下面我们就整理了几个例子大家一起来看看吧.
CSS()方法改变CSS样式 ...
OD常用断点 很全很全 常用断点 拦截窗口: bp CreateWindow 创建窗口 bp CreateWindowEx(A) 创建窗口 bp ShowWindow 显示窗口 bp UpdateWi ...
在viewDidLoad方法里面添加下面这一句代码即可 self.navigationController.interactivePopGestureRecognizer.delegate=(id)s ...
项目环境是php5.3.28 项目用的ThinkPHP3.2.3
已经mysql5.5数据库,要和另一个项目对接,需要连接sqlsever2000数据库进行一些操作. 第一种用php自带扩展连接数据 ...

我要回帖

更多关于 java文件的读取和写入 的文章

 

随机推荐