<?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 Re: How to output multiple rows using a tJava/tJavaRow/tJavaFlex component in Open Studio 7.1? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-output-multiple-rows-using-a-tJava-tJavaRow-tJavaFlex/m-p/2198066#M1556</link>
    <description>&lt;P&gt;Thank you very much, Akumar.&lt;/P&gt; 
&lt;P&gt;I didn't get right the main part (I included the while there).&lt;/P&gt; 
&lt;P&gt;Now works perfectly.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Feb 2019 15:51:59 GMT</pubDate>
    <dc:creator>spr654</dc:creator>
    <dc:date>2019-02-26T15:51:59Z</dc:date>
    <item>
      <title>How to output multiple rows using a tJava/tJavaRow/tJavaFlex component in Open Studio 7.1?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-output-multiple-rows-using-a-tJava-tJavaRow-tJavaFlex/m-p/2198064#M1554</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am trying to use a java class that works perfectly outside Talend. the class opens a bucket, reads the contents, and sets the output variables.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;this is the code that I use in a tJava component, and it only outputs 1 row:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;CouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder()&lt;BR /&gt;.connectTimeout(10000)&lt;BR /&gt;.build();&lt;BR /&gt;Cluster cluster = CouchbaseCluster.create(env,"10.0.0.0");&lt;BR /&gt;Bucket bucket = cluster.openBucket("myBucket","password");&lt;BR /&gt;N1qlQueryResult result = bucket.query(N1qlQuery.simple("SELECT * FROM mybucket" ));&lt;BR /&gt;Iterator&amp;lt;N1qlQueryRow&amp;gt; rowIterator = result.rows();&lt;/P&gt; 
&lt;P&gt;while (rowIterator.hasNext()) {&lt;BR /&gt;N1qlQueryRow row = rowIterator.next();&lt;BR /&gt;// Return results&lt;BR /&gt;String content = row.toString();&lt;BR /&gt;JsonObject obj = (JsonObject) row.value().get("mybucket");&lt;BR /&gt;&lt;BR /&gt;String _class = obj.get("_class").toString();&lt;BR /&gt;if (_class.equalsIgnoreCase("record.type.one") ){&lt;BR /&gt;//transaction id&lt;BR /&gt;String createdByTransactionId = obj.get("createdByTransactionId").toString();&lt;/P&gt; 
&lt;P&gt;//addresses is an optional field&lt;BR /&gt;JsonArray address_obj = null;&lt;BR /&gt;if (obj.get("addresses") != null) {&lt;BR /&gt;address_obj = (JsonArray) obj.get("addresses");&lt;BR /&gt;}}&lt;BR /&gt;row1.createdByTransactionId = createdByTransactionId;&lt;/P&gt; 
&lt;P&gt;}}&lt;BR /&gt;bucket.close();&lt;BR /&gt;env.shutdown();&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;When I use the same code in a tJavaRow, in output I get 0 rows in output.&lt;/P&gt; 
&lt;P&gt;When I use a tJavaFlex component, I get 0 rows in output.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What am I doing wrong?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Any help is welcome.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 15:02:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-output-multiple-rows-using-a-tJava-tJavaRow-tJavaFlex/m-p/2198064#M1554</guid>
      <dc:creator>spr654</dc:creator>
      <dc:date>2019-02-26T15:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to output multiple rows using a tJava/tJavaRow/tJavaFlex component in Open Studio 7.1?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-output-multiple-rows-using-a-tJava-tJavaRow-tJavaFlex/m-p/2198065#M1555</link>
      <description>&lt;P&gt;you need to use tjavaflex , Ideally&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Begin part should have&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;CouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder()&lt;BR /&gt;.connectTimeout(10000)&lt;BR /&gt;.build();&lt;BR /&gt;Cluster cluster = CouchbaseCluster.create(env,"10.0.0.0");&lt;BR /&gt;Bucket bucket = cluster.openBucket("myBucket","password");&lt;BR /&gt;N1qlQueryResult result = bucket.query(N1qlQuery.simple("SELECT * FROM mybucket" ));&lt;BR /&gt;Iterator&amp;lt;N1qlQueryRow&amp;gt; rowIterator = result.rows();&lt;/P&gt; 
&lt;P&gt;while (rowIterator.hasNext()) {&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Main Part&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;N1qlQueryRow row = rowIterator.next();&lt;BR /&gt;// Return results&lt;BR /&gt;String content = row.toString();&lt;BR /&gt;JsonObject obj = (JsonObject) row.value().get("mybucket");&lt;BR /&gt;&lt;BR /&gt;String _class = obj.get("_class").toString();&lt;BR /&gt;if (_class.equalsIgnoreCase("record.type.one") ){&lt;BR /&gt;//transaction id&lt;BR /&gt;String createdByTransactionId = obj.get("createdByTransactionId").toString();&lt;/P&gt; 
&lt;P&gt;//addresses is an optional field&lt;BR /&gt;JsonArray address_obj = null;&lt;BR /&gt;if (obj.get("addresses") != null) {&lt;BR /&gt;address_obj = (JsonArray) obj.get("addresses");&lt;BR /&gt;}}&lt;BR /&gt;row1.createdByTransactionId = createdByTransactionId;&lt;/P&gt; 
&lt;P&gt;}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;End Part&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;bucket.close();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.shutdown();&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Please try and let us know if doesnot work.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 15:18:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-output-multiple-rows-using-a-tJava-tJavaRow-tJavaFlex/m-p/2198065#M1555</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-02-26T15:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to output multiple rows using a tJava/tJavaRow/tJavaFlex component in Open Studio 7.1?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-output-multiple-rows-using-a-tJava-tJavaRow-tJavaFlex/m-p/2198066#M1556</link>
      <description>&lt;P&gt;Thank you very much, Akumar.&lt;/P&gt; 
&lt;P&gt;I didn't get right the main part (I included the while there).&lt;/P&gt; 
&lt;P&gt;Now works perfectly.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 15:51:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-output-multiple-rows-using-a-tJava-tJavaRow-tJavaFlex/m-p/2198066#M1556</guid>
      <dc:creator>spr654</dc:creator>
      <dc:date>2019-02-26T15:51:59Z</dc:date>
    </item>
  </channel>
</rss>

