简体   繁体   English

在文件夹中添加新的Excel工作表时自动更新数据库

[英]Automatically update database when new excel sheet is added in a folder

I need to write one java program which monitors a folder containing excel sheets (.xls format) . 我需要编写一个Java程序来监视包含excel工作表(.xls格式)的文件夹。 Once a new excel sheet is added I have to update the database in db2 and move the excel sheet to other place. 添加新的Excel工作表后,我必须更新db2中的数据库并将Excel工作表移至其他位置。 Please suggest 请建议

It sounds like you need to get notified if files appear in a directory. 听起来好像您需要在文件出现在目录中时得到通知。 Java 7 has good support for this, see this article about the Watch Service API. Java 7中具有这种良好的支持,请参阅文章有关手表服务API。 The db2 part, well it isn't clear what you mean by "update", but likely you want to parse the content of the xls file and make some database updates. db2部分,还不清楚您所说的“更新”是什么意思,但是您可能想解析xls文件的内容并进行一些数据库更新。 Apache POI is a good starting place for reading the content of the file into a Java process. Apache POI是将文件内容读入Java进程的良好起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM