因为要新建一个站,公司要把word表格的部分行列存到数据库中。之前用java操作过excel,本来打算用java从word表格中读取数据,再存到数据库中,结果因为权限不够,无法访问公司要写的那个数据库,跪了跪了。
但还是把java读取word中表格的方法写一下,先上代码。
public static void testWord(String filePath){ try{ FileInputStream in = new FileInputStream(filePath);//载入文档 //如果是office2007 docx格式 if(filePath.toLowerCase().endsWith("docx")){ <