7. 编写代码XlsToAccess.java package com.asima; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; /** */ /** * * @author asima * @data 2006-10-18 */ public class XlsToAccess ... { HSSFSheet globalSheet = null; /**//*读取一个指定单元格内容*/ public String readCellValue(String pos) ...{ int xpos; short ypos; int cellType; /**//*取得此单元格的类型 0-Numeric,1-String,3-null*/ String result; /**//*返回取得的单元格的值*/ ypos = (short) (pos.toUpperCase().charAt(0) - 65); xpos = Integer.parseInt(pos.substring(1, pos.length())) - 1; HSSFRow row = null; /**//* 定义excel中的行 */ HSSFCell cell = null; /**//* 定义excel中的单元格 */ /**//* 根据xPos和yPos取得单元格 */ row = globalSheet.getRow(xpos); cell = row.getCell(ypos); /** *//** **************此处如果是空需要修改********************************** */ cellType = cell.getCellType(); switch (cellType) ...{ case 0: /**//* 0-Numeric */ result = String.valueOf(cell.getNumericCellValue()); break; case 1: /**//* 1-String */ result = ce