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

Five Stars

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. 


Accepted Solutions
Forteen Stars

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


All Replies
Forteen Stars

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

Five Stars

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

Hi,

 

The solution which you have mentioned consist of "tjavarow" component.

Is it necessary to include "tjavarow" in the job?

Is it not possible to extract images directly from the database?

 

Five Stars

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

Hi,

 

I tried and the issue is resolved now.

Thank you so much for your quick response.

 

But i have one more query,is there any specific component where i can extract the images in zip folder form on my local system?

Forteen Stars

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

Hi,

 

you are welcome.

 

what do you mean? just unzip them :-)

 

list files in folder - tFileList

unarchive file - tFileUnarchive

-----------
Five Stars

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

Hi,

 

I want to create a job where i am extracting the blob images from database and storing on local file system as a zip folder.

So can you suggest how can i proceed with this job?

 

 

Forteen Stars

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

still not clear - what it means "zip folder"?

 

do you mean archive each file as zip?

or you mean - zip all files into a single zip file?

 

 

-----------
Five Stars

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

Hi,

 

do you mean archive each file as zip?

Yes 

 zip all files into a single zip file?

Yes

 

I want to know if both the things are possible using any specific component in Talend and if yes how it is been done?

 

 

 

Forteen Stars

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

both - not possible by using any single component

but both - possible by using set of components

 

  1. for each file individually - do as you do now + use tFileArchive at the end
  2. for all in folder - extract all into folder, archive this folder (using the same component)

https://help.talend.com/reader/mjoDghHoMPI0yuyZ83a13Q/~V42EBQClKxKQghNvzHF1g

-----------
Five Stars

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

Hi,

 

Thank you so much for your solution.

I tried and it worked.

Five Stars

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

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.

Highlighted
Five Stars

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

Hi,

 

Can you please provide your feedback on the above issue.

Awaiting your response.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog