title: loading csv file data into oracle database
body: <p>I am trying to load a csv file in oracle database using sql loader through java program. I have successfully executed it by run command, but i want to load csv file data in database through a java program. My programs are:</p>
  
  <ol>
  <li><p>loadCsv.csv:</p>
  
  <pre><code>ID,firstName,LastName,Address
  1,aditya,kumar,gaya
  2,abhijeet,chanda,kol
  3,Rahul,Jordar,kol
  </code></pre></li>
  <li><p>trial.ctl:</p>
  
  <pre><code>LOAD DATA
  INFILE loadCsv.csv
  BADFILE trial.bad
  DISCARDFILE trial.dsc
  APPEND 
  INTO TABLE load1
  FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY "”"
  (x,y,z,t)
  </code></pre></li>
  <li><p>SqlLoaderTest.java:</p>
  
  <pre><code>public class SqlLoaderTest
  {
      public static void main(String[] args) {
          try {
              String sqlldrCmd = "sqlldr control=E:\\load_data\\trial.ctl"+
                 "LOG=trial.log "+
                 "DATA=E:\\load_data\\loadCsv.csv USERID=vehere/adi"+
                 "BAD=E:\\load_data\\trial.bad";
              System.out.println("SQLLDR Started ....... ");
              Runtime rt = Runtime.getRuntime();
              Process proc = rt.exec(sqlldrCmd);
              System.out.println("SQLLDR Ended ........  ");
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre></li>
  </ol>
  
  <p>It is compiled and run successfully but not inserting any data in database. your suggestion is highly appreciated.Thanx in advance.</p>