List<Object[]> result=null;
try {
em = getEntityManager();
if(null!=em){
Query query = em.createNativeQuery("{call procedure Name('"+geoLocationName+"')}");
result =query.getResultList();
}else{
logger.info("Connection is not successfull");
}
}catch (Exception ex) {
logger.error("Error while fetching data from ::"+ex.getMessage());
} finally {
if(null!=em){
em.close();
}
}
我正在使用上面的代码阅读过程
现在,我如何将结果写入到csv文件中,而该文件必须存储在ftp路径中而不存储在本地。
您必须使用Apache Commons CSV和Apache Commons Net来完成工作。
首先,创建两种方法->一种将文件保存在FTP上,另一种创建CSV文件: