<?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 retrieve byteArray/blob from Data base? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310224#M81368</link>
    <description>Sorry just map a byte array input to a byte array output.</description>
    <pubDate>Thu, 31 May 2012 11:56:01 GMT</pubDate>
    <dc:creator>janhess</dc:creator>
    <dc:date>2012-05-31T11:56:01Z</dc:date>
    <item>
      <title>how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310212#M81356</link>
      <description>Hi All,
&lt;BR /&gt;Using Talend job , I need to retrieve images from data base to local system. Images are stored in DB as byte array. 
&lt;BR /&gt;Could any 1 please guide me on this.
&lt;BR /&gt;
&lt;BR /&gt;Thanks In Advance
&lt;BR /&gt;Chaya</description>
      <pubDate>Thu, 31 May 2012 07:35:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310212#M81356</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T07:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310213#M81357</link>
      <description>Hi Chaya&lt;BR /&gt;Which DB do you use? What's the data type of the image column?&lt;BR /&gt;I guess maybe you have to write a custom routine which can retrieve binary from DB into file.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 31 May 2012 07:46:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310213#M81357</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T07:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310214#M81358</link>
      <description>Thanks Pedro, 
&lt;BR /&gt;I m using postgres, column data type is bytea. 
&lt;BR /&gt;I have referred, one of your post , where in you have given, "BlobDemoRoutine" to load images from local system to Data base by using "ByteArrayFromFile" method. 
&lt;BR /&gt;I want to do exactly reverse of this. If I play around with fileOutPutSteam and byte array in java routine that should get me the images back.. am I rite?</description>
      <pubDate>Thu, 31 May 2012 08:52:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310214#M81358</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T08:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310215#M81359</link>
      <description>You probably need base64 encode/decode. 
&lt;BR /&gt;See 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCq7uCAC" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-Send-file-to-WebService/td-p/106745&lt;/A&gt;. 
&lt;BR /&gt;I've also posted a number of other solutions for images.</description>
      <pubDate>Thu, 31 May 2012 08:54:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310215#M81359</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-05-31T08:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310216#M81360</link>
      <description>Hi
&lt;BR /&gt;
&lt;PRE&gt;package routines;&lt;BR /&gt;public class Write {&lt;BR /&gt;	&lt;BR /&gt;	 &lt;BR /&gt;	public static void ByteArrayToFile(byte[] input, String filepath) {&lt;BR /&gt;	  try &lt;BR /&gt;	       {   &lt;BR /&gt;	            java.io.File fp = new java.io.File(filepath);&lt;BR /&gt;	            java.io.FileOutputStream fos = new java.io.FileOutputStream(fp);&lt;BR /&gt;	            fos.write(input);&lt;BR /&gt;	            fos.close();&lt;BR /&gt;	       }&lt;BR /&gt;	       catch(Exception err)&lt;BR /&gt;	       {&lt;BR /&gt;	           err.printStackTrace();&lt;BR /&gt;	           &lt;BR /&gt;	       }&lt;BR /&gt;	}&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;Create a job tPostgresqlInput--main--&amp;gt;tJavaRow.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 31 May 2012 09:21:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310216#M81360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T09:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310217#M81361</link>
      <description>Thanks a lot Pedro &amp;amp; janhess. 
&lt;BR /&gt;Wel Pedro, 
&lt;BR /&gt; I just did exactly what ever you said. Job runs with out any error.. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; &amp;amp; also a .png is created in the specified path 
&lt;BR /&gt;But When I try to open the image in the specified path, I cant see the image, its shows as error message content is corrupted or damaged.. 
&lt;BR /&gt;Am I doing something wrong. Please correct me. 
&lt;BR /&gt; 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;Chaya</description>
      <pubDate>Thu, 31 May 2012 10:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310217#M81361</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T10:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310218#M81362</link>
      <description>Hi Chaya&lt;BR /&gt;Are you sure that the suffix of this image is png?&lt;BR /&gt;Maybe it is jpg or other file.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 31 May 2012 10:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310218#M81362</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T10:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310219#M81363</link>
      <description>Hey Pedro,
&lt;BR /&gt;Yes I m sure, The file is .PNG only
&lt;BR /&gt;I reconfirmed also, by uploading 1 .png to DB and again trying to download the same.</description>
      <pubDate>Thu, 31 May 2012 11:00:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310219#M81363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T11:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310220#M81364</link>
      <description>I think you can read it in as an object type and map this to an object typ output in a tMap. No coding required.</description>
      <pubDate>Thu, 31 May 2012 11:09:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310220#M81364</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-05-31T11:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310221#M81365</link>
      <description>Hi Chaya&lt;BR /&gt;I test it and it works fine.&lt;BR /&gt;Can you save a new image into DB?&lt;BR /&gt;We need to make sure the data in DB is correct.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 31 May 2012 11:13:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310221#M81365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T11:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310222#M81366</link>
      <description>No Luck Pedro, 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;I tried uploading new image to DB (even different formats) &amp;amp; retried to download but no luck. Issue remains the same. 
&lt;BR /&gt;Should I mail You the complete job or upload the screen shots ?</description>
      <pubDate>Thu, 31 May 2012 11:28:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310222#M81366</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T11:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310223#M81367</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I think you can read it in as an object type and map this to an object typ output in a tMap. No coding required.&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Hi janhess, 
&lt;BR /&gt;Thanks.. Could You Please elaborate ur approach, though i read it like an object, how can I write that object with out coding... please explain</description>
      <pubDate>Thu, 31 May 2012 11:30:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310223#M81367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T11:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310224#M81368</link>
      <description>Sorry just map a byte array input to a byte array output.</description>
      <pubDate>Thu, 31 May 2012 11:56:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310224#M81368</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-05-31T11:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310225#M81369</link>
      <description>Thanks janhess .. 
&lt;BR /&gt;Still, I continue to face the same issue, Please fine the attachment. In which I have uploaded the image which I m trying to read from DB and also the job flow.
&lt;BR /&gt;Thanks for ur time..</description>
      <pubDate>Thu, 31 May 2012 12:16:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310225#M81369</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T12:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310226#M81370</link>
      <description>Hi Team,
&lt;BR /&gt;Some where I m going wrong, either reading or may be while uploading to DB itself.
&lt;BR /&gt;So, please look in to the attachments for the way I am uploading my image to DB.
&lt;BR /&gt;&amp;amp; I have already posted the way I m reading it. So, please let me know in case if i m wrong.
&lt;BR /&gt;Routine Code:
&lt;BR /&gt;public static byte[] ByteArrayFromFile(String filepath) {
&lt;BR /&gt; try
&lt;BR /&gt; { 
&lt;BR /&gt; java.io.File file=new java.io.File(filepath);
&lt;BR /&gt; java.io.FileInputStream fis = new java.io.FileInputStream(file);
&lt;BR /&gt; int fileLength = (int) file.length();
&lt;BR /&gt; byte[] incoming_file_data = new byte; 
&lt;BR /&gt; fis.read(incoming_file_data, 0, fileLength ); 
&lt;BR /&gt; fis.close();
&lt;BR /&gt; return incoming_file_data;
&lt;BR /&gt; }
&lt;BR /&gt; catch(Exception err)
&lt;BR /&gt; {
&lt;BR /&gt; err.printStackTrace();
&lt;BR /&gt; return null;
&lt;BR /&gt; }
&lt;BR /&gt; }
&lt;BR /&gt;
&lt;BR /&gt;Please help me on this.,
&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 31 May 2012 12:33:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310226#M81370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T12:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve byteArray/blob from Data base?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310227#M81371</link>
      <description>You didn't specify a field length in your output. Should be the same as input.&lt;BR /&gt;I use this to import images to a database.&lt;BR /&gt;The rule in the tMap is ImageUtil.getByte(row6.abs_path) where abs_path is the path to the image file&lt;BR /&gt;package routines;&lt;BR /&gt;import java.io.FileInputStream;&lt;BR /&gt;import java.io.File;&lt;BR /&gt;import java.io.FileNotFoundException;&lt;BR /&gt;public class ImageUtil {&lt;BR /&gt;	public static byte[] getByte(String filepath) {&lt;BR /&gt;	    byte[] b=null;&lt;BR /&gt;		&lt;BR /&gt;		try {&lt;BR /&gt;			FileInputStream fis = new FileInputStream(filepath);&lt;BR /&gt;			b=new byte;&lt;BR /&gt;			fis.read(b);&lt;BR /&gt;		} catch (Exception e) {&lt;BR /&gt;			e.printStackTrace();&lt;BR /&gt;		}&lt;BR /&gt;		return b;&lt;BR /&gt;	}&lt;BR /&gt;}</description>
      <pubDate>Thu, 31 May 2012 15:22:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-retrieve-byteArray-blob-from-Data-base/m-p/2310227#M81371</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-05-31T15:22:24Z</dc:date>
    </item>
  </channel>
</rss>

