SlideShare a Scribd company logo
MuleSoft ESB
Transfer data from CSV File to Database
By
AKASH PRAJAPATI
Transfer data from CSV File to Database
Topics :
• How to work with Mule and transfer data from CSV file to database
Pre-requisites :
• Basic under standing of Mule ESB
• JDK 1.8 or above
• Anypoint Studio v 6.0.0 or above
• MySQL connector
• Mule Server v 3.8.0 EE or above
• Create database & Schema or use existing one
Create DB Schema & Table
• Create Table
CREATE TABLE test.`EMP_DATA` (
`emp_id` int(11) DEFAULT NULL,
`emp_first_name` varchar(50) DEFAULT NULL,
`emp_last_name` varchar(50) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`dept_id` int(11) DEFAULT NULL,
PRIMARY KEY (`emp_id`,`dept_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Process Flow
Component details
• File : Define Source Path and Move to Directory with Polling frequency
• Transformer ( Object to String ) : Nothing to do here, as it converts object to String internally
• Splitter : Split multiples records (#[StringUtils.split(message.payload, 'nr')] )
• Expression : comma separated record (#[StringUtils.split(message.payload, ',')] )
• Choice : Validating the first row to make sure that there is no header, as expected in the CSV file.
CSV File contains only related data and do not expect to have header row.
• Valid condition: Invoke the Database insert flow
• Default condition : Do not perform any action – Default logging.
• DB Insert Flow: Each single record will be inserted into Database.
MySQL DB
CSV File Records
Header Row :
empId,empFirstname,empLastname,email,deptId
Records in Database : Employee Record
Thank You

More Related Content

PPTX
MuleSoft ESB scatter-gather and base64
PPTX
Mule jdbc
PDF
Passing java arrays in oracle stored procedure from mule esb flow
PPTX
Junit in mule demo
PPTX
Integrate with database by groovy
PDF
MuleSoft ESB Message Enricher
PPTX
Mule new jdbc component
PPTX
Stored Procedure With In Out Parameters in Mule 3.6
MuleSoft ESB scatter-gather and base64
Mule jdbc
Passing java arrays in oracle stored procedure from mule esb flow
Junit in mule demo
Integrate with database by groovy
MuleSoft ESB Message Enricher
Mule new jdbc component
Stored Procedure With In Out Parameters in Mule 3.6

What's hot (13)

DOCX
Mule with jdbc(my sql)
PPT
Spring introduction
PPT
MuleSoft ESB Object Store
PPTX
Mule with stored procedure
ODP
Box connector Mule ESB Integration
PPTX
Message properties component in Mule
PPTX
Mule dataweave
PPTX
Mule esb
PPTX
Mule esb data weave multi input data
PPTX
Mule Esb Data Weave
PPTX
Mule esb :Data Weave
PPT
MuleSoft ESB Routes first-successful
PDF
MuleSoft ESB Shared Library
Mule with jdbc(my sql)
Spring introduction
MuleSoft ESB Object Store
Mule with stored procedure
Box connector Mule ESB Integration
Message properties component in Mule
Mule dataweave
Mule esb
Mule esb data weave multi input data
Mule Esb Data Weave
Mule esb :Data Weave
MuleSoft ESB Routes first-successful
MuleSoft ESB Shared Library
Ad

Viewers also liked (20)

PPTX
Demo on Mule ESB Facebook Connector
PPTX
Mule esb How to convert from CSV to Json in 5 minutes
PDF
Mule esb examples
PDF
UX + Agile: A brief overview on integrating user experience practices with Ag...
PDF
Designing Frameworks For Interaction and User Experience
PPT
Overview of Mule
PPT
Mule deploying a cloud hub application
PPTX
Generating Documentation for Mule ESB Application
PPTX
Mule routing and filters
PPT
Mule connectors
PPTX
Timer Interceptor in Mule
PPTX
Webinar: Elevate Your Enterprise Architecture with In-Memory Computing
PDF
MongoDB Europe 2016 - Distributed Ledgers, Blockchain + MongoDB
PPTX
Mule esb transformers
PPTX
Mule Expression language
PPTX
Mule ESB Training
PPT
Mulesoft ppt
PDF
Future of Integration | MuleSoft
PPTX
Mule ESB Tutorial Part 1
PPTX
Microservices Best Practices
Demo on Mule ESB Facebook Connector
Mule esb How to convert from CSV to Json in 5 minutes
Mule esb examples
UX + Agile: A brief overview on integrating user experience practices with Ag...
Designing Frameworks For Interaction and User Experience
Overview of Mule
Mule deploying a cloud hub application
Generating Documentation for Mule ESB Application
Mule routing and filters
Mule connectors
Timer Interceptor in Mule
Webinar: Elevate Your Enterprise Architecture with In-Memory Computing
MongoDB Europe 2016 - Distributed Ledgers, Blockchain + MongoDB
Mule esb transformers
Mule Expression language
Mule ESB Training
Mulesoft ppt
Future of Integration | MuleSoft
Mule ESB Tutorial Part 1
Microservices Best Practices
Ad

More from akashdprajapati (10)

PPTX
MuleSoft ESB Payload Encrypt using Anypoint Security
PPTX
MuleSoft ESB Scripting Example
PPTX
MuleSoft ESB Filtering data instead of Looping
PPT
MuleSoft ESB XML to CSV
PPT
MuleSoft ESB CSV to XML
PDF
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
PPTX
MuleSoft ESB Sending email using hmailserver
PPTX
Mule Soft ESB - SAP Outbound
PPTX
MuleSoft ESB Testing Mule Application using MUnit Test Suite
PPTX
MuleSoft ESB Composite Source
MuleSoft ESB Payload Encrypt using Anypoint Security
MuleSoft ESB Scripting Example
MuleSoft ESB Filtering data instead of Looping
MuleSoft ESB XML to CSV
MuleSoft ESB CSV to XML
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Sending email using hmailserver
Mule Soft ESB - SAP Outbound
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Composite Source

Recently uploaded (20)

PPTX
Lesson notes of climatology university.
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Cell Types and Its function , kingdom of life
PPTX
Cell Structure & Organelles in detailed.
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Pre independence Education in Inndia.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
master seminar digital applications in india
PDF
Classroom Observation Tools for Teachers
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
GDM (1) (1).pptx small presentation for students
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Lesson notes of climatology university.
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Sports Quiz easy sports quiz sports quiz
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Cell Types and Its function , kingdom of life
Cell Structure & Organelles in detailed.
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Pre independence Education in Inndia.pdf
Final Presentation General Medicine 03-08-2024.pptx
master seminar digital applications in india
Classroom Observation Tools for Teachers
102 student loan defaulters named and shamed – Is someone you know on the list?
GDM (1) (1).pptx small presentation for students
FourierSeries-QuestionsWithAnswers(Part-A).pdf

MuleSoft ESB - CSV File to Database

  • 1. MuleSoft ESB Transfer data from CSV File to Database By AKASH PRAJAPATI
  • 2. Transfer data from CSV File to Database Topics : • How to work with Mule and transfer data from CSV file to database Pre-requisites : • Basic under standing of Mule ESB • JDK 1.8 or above • Anypoint Studio v 6.0.0 or above • MySQL connector • Mule Server v 3.8.0 EE or above • Create database & Schema or use existing one
  • 3. Create DB Schema & Table • Create Table CREATE TABLE test.`EMP_DATA` ( `emp_id` int(11) DEFAULT NULL, `emp_first_name` varchar(50) DEFAULT NULL, `emp_last_name` varchar(50) DEFAULT NULL, `email` varchar(50) DEFAULT NULL, `dept_id` int(11) DEFAULT NULL, PRIMARY KEY (`emp_id`,`dept_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  • 5. Component details • File : Define Source Path and Move to Directory with Polling frequency • Transformer ( Object to String ) : Nothing to do here, as it converts object to String internally • Splitter : Split multiples records (#[StringUtils.split(message.payload, 'nr')] ) • Expression : comma separated record (#[StringUtils.split(message.payload, ',')] ) • Choice : Validating the first row to make sure that there is no header, as expected in the CSV file. CSV File contains only related data and do not expect to have header row. • Valid condition: Invoke the Database insert flow • Default condition : Do not perform any action – Default logging. • DB Insert Flow: Each single record will be inserted into Database.
  • 7. CSV File Records Header Row : empId,empFirstname,empLastname,email,deptId
  • 8. Records in Database : Employee Record