src/com/input/input.java
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.input;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import com.util.DBO;
import com.util.StaticMethod;
public class input {// excel导入类
public List<yonghu> readXls(String path, int num) {// 读
// excel类
Workbook book = null;
Sheet sheet = null;
DBO db = new DBO();// 链接数据库
String sql = "";
String value = "";
String temp = "";
String str = "";
List<yonghu> list = new ArrayList<yonghu>();
try {
FileInputStream in = new FileInputStream(path);// 开始读入excel
book = Workbook.getWorkbook(in);
sheet = book.getSheet(0); // get first sheet.读一个excel sheet页
int cnt = sheet.getRows();
Sheet rs = book.getSheet(0);
int col = rs.getColumns();
Cell cell = null;
System.out.println(num);
for (int i = 1; i < num + 1; i++) {// 行数增加(即增加数据)
yonghu yh=new yonghu();
System.out.print("i=" + i);
value = "";
temp = "";
// sql="insert into shuju(xh,sl1,sl2,sl3,yh,sj) values (";
// //添加数据库数据
if (sheet.getCell(1, i).getContents() != null) {
for (int j = 0; j < 8; j++) {// 列数修改
cell = sheet.getCell(j, i);
if (cell.getContents() != null) {
str = cell.getContents().trim();
} else {
str = "";
后面还有 101 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。