问题描述
我正在一个项目上,从一个星期开始就停滞了,没有找到任何解决方案。我必须上传excel工作表.xls,并且该软件会提取.xls文件(excel工作表)中的特定列,并在jtabel中显示数据,使用netbeans将数据存储在java中的MysqL数据库中。我的代码
public String ReadCellData(int vRow,int vColumn)
{
String value; //variable for storing the cell value
Workbook wb=null; //initialize Workbook null
try
{
//reading data from a file in the form of bytes
FileInputStream fis=new FileInputStream("D:\\Upwork Projects\\TakeOff software by martin\\QUOTE_ScopE.xls");
//constructs an XSSFWorkbook object,by buffering the whole stream into the memory
wb=new hssfWorkbook(fis);
}
catch(FileNotFoundException e)
{
}
catch(IOException e1)
{
}
Sheet sheet=wb.getSheetAt(0); //getting the hssfSheet object at given index
Row row=sheet.getRow(vRow); //returns the logical row
Cell cell=row.getCell(vColumn); //getting the cell representing the given column
value=cell.getStringCellValue(); //getting cell value
return value;
//returns the cell value
}
尚未编写数据库代码。请帮助我编写MysqL数据库代码,或者让我知道我是否必须更改完整的代码
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)