P R U D H V I
ABSTRACT Using of Database component in mule using basic example P R U D H V I
INTRODUCTION The Database connector allows you to connect with almost any Java Database Connectivity (JDBC) relational database using a single interface for every case. The Database connector allows you to run diverse SQL operations on your database, including Select, Insert, Update, Delete, and even Stored Procedures. P R U D H V I
DATABASE CONNECTOR EXAMPLE FLOW P R U D H V I
FLOW: <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule- jdbc-ee.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd"> <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/> <db:mysql-config name="MySQL_Configuration" host="local" port="8061" user="user" password="password" database="DBSAMPLE" doc:name="MySQL Configuration"/> <flow name="DataBase"> <http:listener config-ref="HTTP_Listener_Configuration" path="/DBs" doc:name="HTTP"/> <db:select config-ref="MySQL_Configuration" doc:name="Database"> <db:parameterized-query><![CDATA[Select * from Students]]></db:parameterized-query> </db:select> <logger message="--Result is--#[payload]" level="INFO" doc:name="Logger"/> </flow> </mule> P R U D H V I
Output: [{Name=Student1, Number=55, Name=Abhi, Id=1}, {Name=Student2, Number=25, name=Mahesh, Id=2}, {Name=Student3, Number=65, name=Pavan, Id=3}, {Name=Student4, Number=35, name=Siva, Id=4}] P R U D H V I
Flow of execution: Trigger: http://localhost:8081/db Database component connects to the specific database, executes the query By using logger we are printing the output in the console P R U D H V I
REFERENCES https://docs.mulesoft.com/mule-user-guide/v/3.7/database-connector P R U D H V I
THANK YOU P R U D H V I

Basic example using database component

  • 1.
    P R UD H V I
  • 2.
    ABSTRACT Using of Databasecomponent in mule using basic example P R U D H V I
  • 3.
    INTRODUCTION The Database connectorallows you to connect with almost any Java Database Connectivity (JDBC) relational database using a single interface for every case. The Database connector allows you to run diverse SQL operations on your database, including Select, Insert, Update, Delete, and even Stored Procedures. P R U D H V I
  • 4.
    DATABASE CONNECTOR EXAMPLEFLOW P R U D H V I
  • 5.
    FLOW: <?xml version="1.0" encoding="UTF-8"?> <mulexmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule- jdbc-ee.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd"> <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/> <db:mysql-config name="MySQL_Configuration" host="local" port="8061" user="user" password="password" database="DBSAMPLE" doc:name="MySQL Configuration"/> <flow name="DataBase"> <http:listener config-ref="HTTP_Listener_Configuration" path="/DBs" doc:name="HTTP"/> <db:select config-ref="MySQL_Configuration" doc:name="Database"> <db:parameterized-query><![CDATA[Select * from Students]]></db:parameterized-query> </db:select> <logger message="--Result is--#[payload]" level="INFO" doc:name="Logger"/> </flow> </mule> P R U D H V I
  • 6.
    Output: [{Name=Student1, Number=55, Name=Abhi,Id=1}, {Name=Student2, Number=25, name=Mahesh, Id=2}, {Name=Student3, Number=65, name=Pavan, Id=3}, {Name=Student4, Number=35, name=Siva, Id=4}] P R U D H V I
  • 7.
    Flow of execution: Trigger:http://localhost:8081/db Database component connects to the specific database, executes the query By using logger we are printing the output in the console P R U D H V I
  • 8.
  • 9.
    THANK YOU P RU D H V I