for (int a = 0; a < 26; a++) {
// 获得第一个工作表对象
Sheet sheet = book.getSheet(a);
// 得到第一列第一行的单元格
// 得到第一列第一行的单元格
int columnum = sheet.getColumns();// 得到列数
int rownum = sheet.getRows();// 得到行数
for (int i = 1; i < rownum; i++)// 循环进行读写
{// 行
String key = "";
String value = "";
for (int j = 0; j < columnum; j++) {// 列
Cell cell1 = sheet.getCell(j, i);
String result = cell1.getContents();
if (j == 0) {
key += result;
} else {
value += result;
}
}
// System.out.println(key+"=="+value);
prep.setString(1, key);
prep.setString(2, value);
prep.addBatch();
}
}
conn.setAutoCommit(false);
prep.executeBatch();
conn.setAutoCommit(true);
conn.close();
book.close();
} catch (Exception e) {
System.out.println(e);
}
}
}
标签:SQLite
相关阅读 >>
sqlserver、mysql、oracle三种数据库的优缺点总结
忘记grafana不要紧2种grafana重置admin密码方法详细步骤
python sqlalchemy的mapping与declarative详解
python3 tkinkter + Sqlite实现登录和注册界面
更多相关阅读请进入《Sqlite》频道 >>

数据库系统概念 第6版
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。