How to insert images into a MySQL table with BLOB type - 7.3

Data Integration Job Examples

Version
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development > Designing Jobs
Last publication date
2023-11-13
This article explains how to insert images into a MySQL table with BLOB type.

Some projects require a large string or block of binary data to be stored in a database. A BLOB (Binary Large Object) is a data type that can be used to store a large collection of binary data in a database table. A CLOB (Character Large Object) is a data type that can be used to store a large collection of character data in a database table.

For example, a digital file containing a picture, video, or a song can be stored in a database using a BLOB, or a plain text file can be stored in a database using a CLOB. This article explains how to insert images into a Mysql table with BLOB type.

The example can be adapted, with minor changes, to use the CLOB type or another database.

Prerequisites

  • This example uses a MySQL table, named blobdemo, with two fields: Id and Picture. The table definition is as follows:
  • A specific folder, in this example "C:/Talend/images", stores the pictures that will be inserted into the blobdemo table.