Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Aish123
Contributor
Contributor

To extract the blob images from MySql database and store it in local file system.

Hi,

I am trying to extract the images stored in blob from MYSql database and store it in local file system.
I have used tLOBDownload component for executing this job.
But while running this job i am getting the below mentioned error:

 

Error:
Exception in component tLOBDownload_1 (BlobDb_to_XML)
java.lang.Exception: Given object is not a Blob. It is of type:[B
at de.cimt.talendcomp.lob.download.LOBDownload.downloadLob(LOBDownload.java:136)
at newproject.blobdb_to_xml_0_1.BlobDb_to_XML.tDBInput_1Process(BlobDb_to_XML.java:690)
at newproject.blobdb_to_xml_0_1.BlobDb_to_XML.runJobInTOS(BlobDb_to_XML.java:1072)
at newproject.blobdb_to_xml_0_1.BlobDb_to_XML.main(BlobDb_to_XML.java:907)

 

I have attached the screenshot of the job.

Please help me with this issue. 

Labels (5)
12 Replies
Aish123
Contributor
Contributor
Author

Hi,

 

I have some more requirements in my job.

I have attached the screenshot of the job.

 

I need to extract the blob images in the same archive folder where my output XML file is getting stored.

Is it possible to do that in a single job?

I am not able to connect my tLOBDownload to tArchive.

Please help.


job.PNG
Aish123
Contributor
Contributor
Author

Hi,

 

Can you please provide your feedback on the above issue.

Awaiting your response.

CPiferAttain
Contributor
Contributor

This is a data type problem, specific with using tLOBDownload with MySQL.

Mysql provides the output as Byte[] and tLOBDownload wants a Java Object (specifically a blob). To do the conversion:

 

1) Add a tMap to your job

2) Set the blob column type in your input schema as byte[] and your output column type to Object

3) Map your column with the following method call:

 

new javax.sql.rowset.serial.SerialBlob(row1.myblobcolumn)

 

(obviously replace the column name with your column name).

Details on this method in the Java Docs are here::

https://docs.oracle.com/en/java/javase/11/docs/api/java.sql.rowset/javax/sql/rowset/serial/SerialBlo...