<?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: [resolved] Load pdf file into oracle database in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227736#M19256</link>
    <description>well done!</description>
    <pubDate>Thu, 06 Mar 2014 15:30:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-03-06T15:30:01Z</dc:date>
    <item>
      <title>[resolved] Load pdf file into oracle database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227732#M19252</link>
      <description>Hi,
&lt;BR /&gt; Could somebody help me to load the pdf file to oracle DB. I have gone through few posts but didn't help. Kindly help me on this.
&lt;BR /&gt;Note: My oracle table column data type is BLOB.
&lt;BR /&gt;Thanks in advance,
&lt;BR /&gt;Natarajan P</description>
      <pubDate>Wed, 05 Mar 2014 15:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227732#M19252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-05T15:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Load pdf file into oracle database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227733#M19253</link>
      <description>I am currently developing a tLOBUpload component. I guess it will be finished this weekend. 
&lt;BR /&gt;You can do your job with self written Java code. Establish a prepared statement and set a input stream. 
&lt;BR /&gt;For more details please refer the Java doc of the current JDBC API.</description>
      <pubDate>Wed, 05 Mar 2014 20:25:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227733#M19253</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-05T20:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Load pdf file into oracle database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227734#M19254</link>
      <description>Thanks for your response. I have below JDBC prepared statement code to upload the file, But not sure where to place this code in tJDBCOutput component, 
&lt;BR /&gt; 
&lt;PRE&gt; File image = new File("C:\\FileUpload.pdf");  &lt;BR /&gt;            psmnt = connection.prepareStatement("insert into FileUpload(name, city, image, Phone) "+ "values(?,?,?,?)");  &lt;BR /&gt;            psmnt.setString(1,"mahendra");  &lt;BR /&gt;            psmnt.setString(2,"Delhi");  &lt;BR /&gt;            psmnt.setString(4,"123456");  &lt;BR /&gt;            fis = new FileInputStream(image);  &lt;BR /&gt;            psmnt.setBinaryStream(3, (InputStream)fis, (int)(image.length()));  &lt;BR /&gt;            int s = psmnt.executeUpdate();&lt;/PRE&gt; 
&lt;BR /&gt;Kindly help.</description>
      <pubDate>Thu, 06 Mar 2014 09:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227734#M19254</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-06T09:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Load pdf file into oracle database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227735#M19255</link>
      <description>I have resolved the problem. Here is the updated code- In case somebody else needed, 
&lt;BR /&gt; 
&lt;PRE&gt;public static byte[] ByteArrayFromFile(String filePath) {&lt;BR /&gt;			File file = new File(filePath);&lt;BR /&gt;	        FileInputStream fis = null;&lt;BR /&gt;			try {&lt;BR /&gt;				fis = new FileInputStream(file);&lt;BR /&gt;			} catch (FileNotFoundException e) {&lt;BR /&gt;					e.printStackTrace();&lt;BR /&gt;			}&lt;BR /&gt;	        ByteArrayOutputStream bos = new ByteArrayOutputStream();&lt;BR /&gt;	        byte[] buf = new byte;&lt;BR /&gt;	        try {&lt;BR /&gt;	            for (int readNum; (readNum = fis.read(buf)) != -1;) {&lt;BR /&gt;	                bos.write(buf, 0, readNum); //no doubt here is 0&lt;BR /&gt;	                System.out.println("read " + readNum + " bytes,");&lt;BR /&gt;	            }&lt;BR /&gt;	        } catch (IOException ex) {&lt;BR /&gt;	          System.out.println(ex);&lt;BR /&gt;	        }&lt;BR /&gt;	        byte[] bytes = bos.toByteArray();&lt;BR /&gt;	        return bytes;&lt;BR /&gt;    }&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.talend.com/legacyfs/online/membersTempo/149879/129220_Img1.PNG" /&gt;</description>
      <pubDate>Thu, 06 Mar 2014 13:16:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227735#M19255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-06T13:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Load pdf file into oracle database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227736#M19256</link>
      <description>well done!</description>
      <pubDate>Thu, 06 Mar 2014 15:30:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Load-pdf-file-into-oracle-database/m-p/2227736#M19256</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-06T15:30:01Z</dc:date>
    </item>
  </channel>
</rss>

