<?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>question Re: How can I get warning from impala from JDBC? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-get-warning-from-impala-from-JDBC/m-p/306733#M222983</link>
    <description>&lt;P&gt;I think you want to put the result set getWarnings() inside the while loop.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;(rs.&lt;SPAN&gt;next&lt;/SPAN&gt;()){&lt;BR /&gt;     &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;out&lt;/SPAN&gt;.&lt;SPAN&gt;println&lt;/SPAN&gt;(rs.&lt;SPAN&gt;getInt&lt;/SPAN&gt;(&lt;SPAN&gt;"id"&lt;/SPAN&gt;));&lt;BR /&gt;&lt;SPAN&gt;     if (rs.getWarnings() != null ) {&lt;BR /&gt;          System&lt;/SPAN&gt;.&lt;SPAN&gt;out&lt;/SPAN&gt;.&lt;SPAN&gt;println&lt;/SPAN&gt;(rs.&lt;SPAN&gt;getWarnings&lt;/SPAN&gt;());&lt;BR /&gt;&lt;SPAN&gt;          System&lt;/SPAN&gt;.&lt;SPAN&gt;out&lt;/SPAN&gt;.&lt;SPAN&gt;println&lt;/SPAN&gt;(rs.&lt;SPAN&gt;clearWarnings&lt;/SPAN&gt;());&lt;BR /&gt;     }&lt;BR /&gt;}&lt;/PRE&gt;&lt;P data-unlink="true"&gt;According to the &lt;A href="https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html" target="_self"&gt;JDBC ResultSe&lt;/A&gt;t docs,&amp;nbsp;&amp;nbsp;&amp;nbsp;ResultSet warnings are set for each row when you call a method on the ResultSet which you haven't done yet in your current code.&amp;nbsp; &amp;nbsp; Also, warnings on multiple rows are appended which is why I added the clearWarning().&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2020 15:19:57 GMT</pubDate>
    <dc:creator>Mike in Austin</dc:creator>
    <dc:date>2020-12-02T15:19:57Z</dc:date>
  </channel>
</rss>

