这是一个JAVA的jdbc驱动包,可以帮助你想操作数据库一样快速操作excel
示例代码:
public static void main(String[] vars){
String driver = "com.hxtt.sql.excel.ExcelDriver";
String url = "jdbc:excel:///C:\\Users\\papio\\Desktop\\excel.xls";
try {
Class.forName(driver).newInstance();
Connection con = DriverManager.getConnection(url);
Statement stm = con.createStatement();
String sql = "select * from sheet";
for(int i=0;i<50;i++){
ResultSet rs = stm.executeQuery(sql);
while (rs.next()){
System.out.println(rs.getString("NAME"));
}
System.out.println("第几次:"+i);
}
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
}
}
1