DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Java and MongoDB Integration: A CRUD Tutorial [Video Tutorial]
  • How to Seamlessly Integrate Data Into NetSuite
  • DZone Community Awards 2022
  • Streaming in Mule

Trending

  • Infrastructure as Code (IaC) Beyond the Basics
  • How GitHub Copilot Helps You Write More Secure Code
  • After 9 Years, Microsoft Fulfills This Windows Feature Request
  • Memory Leak Due to Time-Taking finalize() Method
  1. DZone
  2. Data Engineering
  3. Data
  4. Database Integration in WSO2 EI 7.1.0

Database Integration in WSO2 EI 7.1.0

This article demonstrates how we can integrate with databases and do data manipulation in WSO2 EI 7.1.0.

By 
Suman Mohan user avatar
Suman Mohan
·
Jan. 17, 22 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
4.5K Views

Join the DZone community and get the full member experience.

Join For Free

Pre-Requisites

  1. Windows 10 OS.
  2. MySQL 8.0 server and Command-Line Client.
  3. JDBC driver for MySQL (http://dev.mysql.com/downloads/connector/j/). Download it to your local machine.
  4. WSO2 Integration Studio 8.0.0.

Implementation Steps

DB Creation (Run the below commands in MySQL command-line client to create a database and table for this demo)->

  1. Create Database Students
  2. Use Students
  3. CREATE TABLE Students (StudentID int, FirstName varchar(255), LastName varchar(255), Result varchar(255))

Service Implementation in Integration Studio

     1. Create a new Maven Multi-Module project on Getting Started page.

Screenshot - 1

    2. Enter the details as below in Maven Modules Creation Wizard.

Screenshot - 2

     3. Right-click on the new maven project and select New -> Data Service Configs and enter the details as below.

Screenshot - 3

      4. Click Next and verify the details are as below and then click on Finish. Details can be edited if needed.

Screenshot - 4

        5. Right Click on the maven project and select New -> Composite Exporter and enter Module Name as DBIntegration_CAR. Click Next, then verify details as in Step 4. Specify parent as DBIntegrationProject and click on Finish.

       6. The structure of the project will look as below:

Screenshot - 5

       7. Right-click DBIntegrationModule and select New -> Data Service. Then select Create a New Data Service and click Next. Enter Data Service name and click Finish.

            Screenshot - 6

        8. A new StudentsDataService.dbs file gets created. Click on Configure Data Sources and then Add New. Enter the details as below. Enter the username and password for your MySQL DB, test the connection, and verify it is successful.

Screenshot - 7

                Screenshot - 8

         9. Click on Configure Queries and add 3 queries to add, get and update student data in the DB.

               Screenshot - 9

               i) Add student data – Enter the query and add input mappings manually by clicking Add New as below.

                   Screenshot - 10

                       Screenshot - 11

               ii) Get student data – Enter the query and add input and output mappings automatically by clicking Generate as below.

Screenshot - 12

                    Screenshot - 13

                              Screenshot - 14

                    iii) Update student data – Enter the query and add input mappings manually by clicking Add New as below.

                           Screenshot - 15

                           Screenshot - 16

         10. Click on Configure Resources and add 3 resources as below.

                 Screenshot - 17

Deployment: We will be using the embedded Micro Integrator server available in the WSO2 Integration studio to run our service.

            1. Click on the Embedded Micro Integrator server icon found at the top of the Integration Studio. Then click the + icon and add the MySQL driver jar (Step 2 of Prerequisites) to the /lib directory of the embedded Micro Integrator server. Click Save.

                  Screenshot - 18

              2. Right-click on the DBIntegration_CAR module in the project explorer in Integration Studio and click on Export Project Artifacts and Run.

              3. In the dialog box that opens select the required artifacts and click Finish as shown below. In our case, DBIntegrationModule is the required artifact.

Screenshot - 19

Testing: After the embedded Micro Integrator server starts, we can test this service using Postman as shown in the below images. We can also test using the inbuilt HTTP client present in WSO2 Integration Studio. The HTTP listener port is 8290 by default.

             1. Add student data.

Screenshot - 20

           2. Get student data.

Screenshot - 21

          3. Update student data.

Screenshot - 22

           4. Get updated student data.
Screenshot - 23

That's it! I hope you enjoyed reading this post. 

Database Integration Data (computing)

Opinions expressed by DZone contributors are their own.

Related

  • Java and MongoDB Integration: A CRUD Tutorial [Video Tutorial]
  • How to Seamlessly Integrate Data Into NetSuite
  • DZone Community Awards 2022
  • Streaming in Mule

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!