MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 怎么将EXCEL数据导入access数据库中的表中去

怎么将EXCEL数据导入access数据库中的表中去(2)

www.MyException.Cn  网友分享于:2013-02-13  浏览:149次

// HSSFCell dataCell = (HSSFCell)cellIt.next();
HSSFCell dataCell = dataRow.getCell(currentCol);
// currentCol = dataCell.getCellNum();
cellNumber = currentCol;
Object colType = importColumns.get(currentCol);
if (colType instanceof Map) {
//进行字段的校验和转换
Map tempcolType = (Map) colType;
String cellContent = getStringFromCell(dataCell);

String allownull = (String) tempcolType.get( "allownull ");
String dbname = (String) tempcolType.get( "dbname ");
String format = (String) tempcolType.get( "format ");
Integer maxlength = (Integer) tempcolType.get( "maxlength ");
String dictionary = (String) tempcolType.get( "dictionary ");
System.out.println(dbname + " = " + cellContent);
if (dbname == null) dbname = " ";
//进行非空检验
if (allownull == null) allownull = "true ";
if (allownull.equals( "false ")) {
if (cellContent == null || cellContent.trim().equals( " ")) {
flag = "false ";

------解决方案--------------------
向楼上的同志学习!!!
------解决方案--------------------
先上传excle文件,然后用jxl或poi解析,然后insert到数据库
http://blog.csdn.net/lcllcl987/archive/2005/01/12/250129.aspx

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有