<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic NullpointerException at PreparedStatement.executeBatch by setting &amp;quot;Com in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/NullpointerException-at-PreparedStatement-executeBatch-by/m-p/2333087#M101906</link>
    <description>hi; 
&lt;BR /&gt;I use the tTeradataOutput in Java. 
&lt;BR /&gt;when Input_row.NB_LINE mod CommityEvery = 0 
&lt;BR /&gt;NullPointerException by PreparedStatement.executeBatch because it did not call PreparedStatement.addBatch. 
&lt;BR /&gt; 
&lt;PRE&gt;/**&lt;BR /&gt; *  start&lt;BR /&gt; */&lt;BR /&gt;currentComponent = "tTeradataOutput_1";&lt;BR /&gt;try {&lt;BR /&gt;  pstmt_tTeradataOutput_1.executeBatch();&lt;BR /&gt;  insertedCount_tTeradataOutput_1 += pstmt_tTeradataOutput_1&lt;BR /&gt;      .getUpdateCount();&lt;BR /&gt;} catch (java.sql.BatchUpdateException e) {&lt;BR /&gt;  System.err.println(e.getMessage());&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;Please call method only when it is necessary. 
&lt;BR /&gt; 
&lt;PRE&gt;/**&lt;BR /&gt; *  start&lt;BR /&gt; */&lt;BR /&gt;currentComponent = "tTeradataOutput_1";&lt;BR /&gt;//##### add.start&lt;BR /&gt;if (commitCounter_tTeradataOutput_1 &amp;gt; 0) {&lt;BR /&gt;//##### add.end&lt;BR /&gt;  try {&lt;BR /&gt;    pstmt_tTeradataOutput_1.executeBatch();&lt;BR /&gt;    insertedCount_tTeradataOutput_1 += pstmt_tTeradataOutput_1&lt;BR /&gt;        .getUpdateCount();&lt;BR /&gt;  } catch (java.sql.BatchUpdateException e) {&lt;BR /&gt;    System.err.println(e.getMessage());&lt;BR /&gt;  }&lt;BR /&gt;//##### add.start&lt;BR /&gt;} // end of commitCounter_tTeradataOutput_1 &amp;gt;0&lt;BR /&gt;//##### add.end&lt;/PRE&gt; 
&lt;BR /&gt;I think it is the same as "Use Batch(Batch size)". 
&lt;BR /&gt;Regards</description>
    <pubDate>Sat, 16 Nov 2024 13:34:10 GMT</pubDate>
    <dc:creator>izumisawaa</dc:creator>
    <dc:date>2024-11-16T13:34:10Z</dc:date>
    <item>
      <title>NullpointerException at PreparedStatement.executeBatch by setting "Com</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NullpointerException-at-PreparedStatement-executeBatch-by/m-p/2333087#M101906</link>
      <description>hi; 
&lt;BR /&gt;I use the tTeradataOutput in Java. 
&lt;BR /&gt;when Input_row.NB_LINE mod CommityEvery = 0 
&lt;BR /&gt;NullPointerException by PreparedStatement.executeBatch because it did not call PreparedStatement.addBatch. 
&lt;BR /&gt; 
&lt;PRE&gt;/**&lt;BR /&gt; *  start&lt;BR /&gt; */&lt;BR /&gt;currentComponent = "tTeradataOutput_1";&lt;BR /&gt;try {&lt;BR /&gt;  pstmt_tTeradataOutput_1.executeBatch();&lt;BR /&gt;  insertedCount_tTeradataOutput_1 += pstmt_tTeradataOutput_1&lt;BR /&gt;      .getUpdateCount();&lt;BR /&gt;} catch (java.sql.BatchUpdateException e) {&lt;BR /&gt;  System.err.println(e.getMessage());&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;Please call method only when it is necessary. 
&lt;BR /&gt; 
&lt;PRE&gt;/**&lt;BR /&gt; *  start&lt;BR /&gt; */&lt;BR /&gt;currentComponent = "tTeradataOutput_1";&lt;BR /&gt;//##### add.start&lt;BR /&gt;if (commitCounter_tTeradataOutput_1 &amp;gt; 0) {&lt;BR /&gt;//##### add.end&lt;BR /&gt;  try {&lt;BR /&gt;    pstmt_tTeradataOutput_1.executeBatch();&lt;BR /&gt;    insertedCount_tTeradataOutput_1 += pstmt_tTeradataOutput_1&lt;BR /&gt;        .getUpdateCount();&lt;BR /&gt;  } catch (java.sql.BatchUpdateException e) {&lt;BR /&gt;    System.err.println(e.getMessage());&lt;BR /&gt;  }&lt;BR /&gt;//##### add.start&lt;BR /&gt;} // end of commitCounter_tTeradataOutput_1 &amp;gt;0&lt;BR /&gt;//##### add.end&lt;/PRE&gt; 
&lt;BR /&gt;I think it is the same as "Use Batch(Batch size)". 
&lt;BR /&gt;Regards</description>
      <pubDate>Sat, 16 Nov 2024 13:34:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NullpointerException-at-PreparedStatement-executeBatch-by/m-p/2333087#M101906</guid>
      <dc:creator>izumisawaa</dc:creator>
      <dc:date>2024-11-16T13:34:10Z</dc:date>
    </item>
  </channel>
</rss>

