title: Teradata-jdbc: What's the point of using Fastload if java has memory limitations?
body: <p>Here is the link to a sample jdbc Fastload program from the teradata website :  <a href="http://developer.teradata.com/doc/connectivity/jdbc/reference/current/samp/T20205JD.java.txt" rel="nofollow">http://developer.teradata.com/doc/connectivity/jdbc/reference/current/samp/T20205JD.java.txt</a></p>
  
  <p>It inserts only one row so I modified it to insert 500K rows by replacing the following code  :  </p>
  
  <pre><code>                        pstmt.setInt(1, 1);
                          pstmt.setString(2, strBuf);
                          pstmt.addBatch();
                          batchCount++;
  </code></pre>
  
  <p>with : </p>
  
  <pre><code>                        for (int i = 0; i &lt; 500000 ; i ++ ) {
                          pstmt.setInt(1, i);
                          pstmt.setString(2, strBuf);
                          pstmt.addBatch();
                          batchCount++;
                          }
  </code></pre>
  
  <p>It of course failed because java was out of memory.</p>
  
  <p>So Fastloads jdbc fails to    upload EVEN  500K rows of very simple data  . .  because the method <code>addBatch()</code>    throws <code>outOfMemory</code> exception at some point.</p>
  
  <p>But  I read that Fastload was able to upload millions of rows ! ! ! However I could not find any real example anywhere . How to overcome <code>outOfMemory</code> java exception ? </p>
  
  <p><strong>Can anybody show an example with <code>jdbc</code> and <code>Fastload</code> (NOT FastloadCSV!) to upload let's say 1M rows ?</strong> </p>
  
  <hr>
  
  <p>PS : </p>
  
  <p>1) <code>xmx</code> increase of heap space defeats the purpose, because every additional <code>addBatch()</code> methods executes slower, and additional heap has limitations ( usually 4 g ) </p>
  
  <p>2) I do not need <code>FastloadCSV</code> , because it does not support text qualifiers until ttu 14 and has other issues </p>