SSI实现 excel 与ORACLE 之间的导入导出
1.导入相应的jar包
?
?
3. web.xml的配置
?
?
4.struts.xml的配置
?
?
5.applicationContext.xml的配置
?
?
6.jdbc_user_zhaoyun.properties 属性文件
?
?
8.sqlmap-user.xml的配置
?
?package com.daizhaoyun.tools;import java.io.File;import java.io.IOException;import java.util.ArrayList;import java.util.List;import jxl.Cell;import jxl.Sheet;import jxl.Workbook;import jxl.read.biff.BiffException;public class GoToOracle {public List<String> insert(String path) {List<String> list = new ArrayList<String>();File file = new File(path);// 创建新的Excel 工作簿Workbook rwb = null;try {rwb = Workbook.getWorkbook(file);} catch (BiffException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}// 得到工作簿中的第一个表索引即为excel下的sheet1,sheet2,sheet3...Sheet sheet = rwb.getSheets()[0];int rsColumns = sheet.getColumns();// 列数int rsRows = sheet.getRows();// 行数String simNumber = "";// 每个单元格中的数据String str = "";// 拼接要插入的列for (int i = 1; i < rsRows; i++) {for (int j = 0; j < rsColumns; j++) {Cell cell = sheet.getCell(j, i);simNumber = cell.getContents();if(j == rsColumns - 1){str += simNumber;}else{str += simNumber + ",";}}list.add(str);str = "";}return list;}}?14.通过http://localhost:8080/excel/ getAllUser.action访问