网站一键生成app,wordpress的登录,南宁响应式网站制作,重庆建设工程交易网原文地址:http://blog.csdn.net/ysughw/article/details/9288307 POI操作Excel时偶尔会出现Cannot get a text value from a numeric cell的异常错误。 异常原因#xff1a;Excel数据Cell有不同的类型#xff0c;当我们试图从一个数字类型的Cell读取出一个字符串并写入数据库…原文地址:http://blog.csdn.net/ysughw/article/details/9288307 POI操作Excel时偶尔会出现Cannot get a text value from a numeric cell的异常错误。 异常原因Excel数据Cell有不同的类型当我们试图从一个数字类型的Cell读取出一个字符串并写入数据库时就会出现Cannot get a text value from a numeric cell的异常错误。 此异常常见于类似如下代码中row.getCell(0).getStringCellValue() 解决办法先设置Cell的类型然后就可以把纯数字作为String类型读进来了 if(row.getCell(0)!null){ row.getCell(0).setCellType(Cell.CELL_TYPE_STRING); stuUser.setPhone(row.getCell(0).getStringCellValue()); }