title: Java code to store result of procedure using JPA in a CSV file and save it in FTP Path without storing it in local computer
body: <p>JPA code :</p>
  
  <pre><code>List&lt;Object[]&gt; result=null;
  try {
     em = getEntityManager();
     if(em != null){
       Query query = em.createNativeQuery("{call procedure Name('"+geoLocationName+"')}"); 
       result = query.getResultList(); 
     } else {
       logger.info("Connection is not successful");
     }
  } catch (Exception ex) {
    logger.error("Error while fetching data from ::"+ex.getMessage());
  } finally {
    if(em != null) {
       em.close();
    }
  } 
  </code></pre>
  
  <p>I am reading a procedure by using the above code.</p>
  
  <p>How can I write this result into a CSV file, which has to store into a FTP path without storing it locally ?</p>