我们有以下逻辑 - 从数据库写入数据的数据提取到
1.FlatFile
2.ExcelFile
3.ZipFile
4.将ZIP转移到FTP
现在我已经编写了一个程序,它工作正常,但我正在考虑通过MyThreading或其他任何方式提高性能
有人可以提出想法。
请找到程序结构:
//method to get all data from database
Vector plans=getOnlyPlanId(); // here i will have 5000 planIds
for(i=0;i<500;i++) // loop for plans/500 -----Point number 1
{
String FiveHundresplanId="500 plans";
//i will makes first 500 plansid and send to database to get data....
Vector PlansData=getAllPlansData(FiveHundresplanId); // here i will get data like 21000+ for first 500 plans
//now , loop for 21000 planData
for(i=0;i<plansdata.size;i++)
{
createFlatFile();
createExcelFile();
createZipOfallFiles();
TrasferZipToFTP();
}
}
我想在这里,我在向FlatFile,ExcelFile,ZipFile写入数据的同时可以要求程序执行我的(Point number1)500计划查询并为下一个500计划做好准备,以便像我们一样将文件传输到FTP我们不需要等待执行下一个500计划查询。
这会改善性能吗?
如果是的话我们怎么做才能做到?