SlideShare a Scribd company logo
1 of 8
 The main motto of this PPT is How to use
Bean as Datasource in Database connector in
our applications.
 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.
.mflow
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc"
xmlns:http="http://www.mulesoft.org/schema/mule/http" 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.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd">
<spring:beans>
<spring:bean id="Bean1" name="Bean" class="org.enhydra.jdbc.standard.StandardDataSource">
<spring:property name="driverName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<spring:property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=test1;user=*****;password=******"/>
</spring:bean>
</spring:beans>
<jdbc-ee:connector name="Database" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"
dataSource-ref="Bean1"/>
<context:property-placeholder location="file:${mule_home}/conf/esb-ecomm-details.properties,file:${mule_home}/conf/esb-soa-vmes-
db.properties,file:${mule_home}/conf/esb-ecom-sf-query-details.properties,file:${mule_home}/conf/esb-ecom-
error.properties,file:${mule_home}/conf/esb-vpdm-details.properties"/>
<flow name="DataBase_BeanFlow1" doc:name="DataBase_BeanFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8089" doc:name="HTTP" path="dbtest"/>
<logger message="--entered" level="INFO" doc:name="Logger"/>
<jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-ref="Database"
doc:name="Database">
<jdbc-ee:query key="select" value="select * from mytable"/>
</jdbc-ee:outbound-endpoint>
<logger message="--after db--#[payload]" level="INFO" doc:name="Logger"/>
</flow>
</mule>
 Output:
 INFO 2015-12-12 05:49:03,286 [main] org.mule.DefaultMuleContext:
 **********************************************************************
 * Application: database_bean *
 * OS encoding: Cp1252, Mule encoding: UTF-8 *
 * *
 * Agents Running: *
 * Clustering Agent *
 * JMX Agent *
 **********************************************************************
 INFO 2015-12-12 05:49:03,288 [main] org.mule.module.launcher.MuleDeploymentService:
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++
 + Started app 'database_bean' +
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++
 INFO 2015-12-12 05:49:42,464 [[database_bean].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --entered
 INFO 2015-12-12 05:49:42,473 [[database_bean].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Database.dispatcher.543460185'.
Object is: EEJdbcMessageDispatcher
 INFO 2015-12-12 05:49:42,474 [[database_bean].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Database.dispatcher.543460185'. Object
is: EEJdbcMessageDispatcher
 INFO 2015-12-12 05:49:42,770 [[database_bean].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --after db--[{subj=Hindi, marks=55,
name=Ramesh, id=1}, {subj=English, marks=65, name=Mahesh, id=2}, {subj=science,
marks=75, name=Pavan, id=3}, {subj=social, marks=45, name=Siva, id=4}]
 Flow of execution:
1. URL to trigger the service from browser
http://localhost:8089/dbtest
2. Database component connects to the specific
database, executes the select query and prints
the result
 https://docs.mulesoft.com/mule-user-
guide/v/3.7/database-connector

More Related Content

What's hot

How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmdfkhan625
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmaheshtheapex
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in MuleMohammed246
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in MuleKhan625
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in muleRajkattamuri
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter Praneethchampion
 

What's hot (10)

How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Expression Filters
Expression FiltersExpression Filters
Expression Filters
 
How to use jms outbound endpoint
How to use jms outbound endpointHow to use jms outbound endpoint
How to use jms outbound endpoint
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter
 

Viewers also liked (16)

How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholder
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
 
Splitter
SplitterSplitter
Splitter
 
How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
 
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategy
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
 
Sap
SapSap
Sap
 
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
 
Expression
ExpressionExpression
Expression
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
 
Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
 
Data Mapper
Data MapperData Mapper
Data Mapper
 

Similar to Bean as Datasource

Database component in mule demo
Database component in mule demoDatabase component in mule demo
Database component in mule demoSudha Ch
 
How to use bean as datasource in database connector
How to use bean as datasource in database connectorHow to use bean as datasource in database connector
How to use bean as datasource in database connectorRaviRajuRamaKrishna
 
Database component in mule
Database component in muleDatabase component in mule
Database component in muleRajkattamuri
 
Database component
Database component Database component
Database component F K
 
Mule Database component
Mule Database component Mule Database component
Mule Database component AbdulImrankhan7
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mulejaveed_mhd
 
Basic example using database component
Basic example using database componentBasic example using database component
Basic example using database componentprudhvivreddy
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demoSudha Ch
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in muleKhan625
 
How to use data mapper transformer
How to use data mapper transformerHow to use data mapper transformer
How to use data mapper transformermaheshtheapex
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponentakshay yeluru
 
How to use data mapper transformer
How to use data mapper transformerHow to use data mapper transformer
How to use data mapper transformerRaviRajuRamaKrishna
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each componentprudhvivreddy
 
Message properties component
Message properties component Message properties component
Message properties component Sunil Komarapu
 

Similar to Bean as Datasource (20)

Database component in mule demo
Database component in mule demoDatabase component in mule demo
Database component in mule demo
 
How to use bean as datasource in database connector
How to use bean as datasource in database connectorHow to use bean as datasource in database connector
How to use bean as datasource in database connector
 
Database Component
Database ComponentDatabase Component
Database Component
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Database component
Database component Database component
Database component
 
Database component
Database component Database component
Database component
 
Mule Database component
Mule Database component Mule Database component
Mule Database component
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Basic example using database component
Basic example using database componentBasic example using database component
Basic example using database component
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demo
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
How to use data mapper transformer
How to use data mapper transformerHow to use data mapper transformer
How to use data mapper transformer
 
How to use wildcard filter
How to use wildcard filterHow to use wildcard filter
How to use wildcard filter
 
How to use data weave
How to use data weaveHow to use data weave
How to use data weave
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
 
How to use data mapper transformer
How to use data mapper transformerHow to use data mapper transformer
How to use data mapper transformer
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
 
How to use jms inbound endpoint
How to use jms inbound endpointHow to use jms inbound endpoint
How to use jms inbound endpoint
 
Message properties component
Message properties component Message properties component
Message properties component
 

More from sivachandra mandalapu (9)

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
 
Jms selector
Jms selectorJms selector
Jms selector
 
Sftplite
SftpliteSftplite
Sftplite
 
Object store
Object storeObject store
Object store
 
Soap Component
Soap ComponentSoap Component
Soap Component
 
Rest Component
Rest ComponentRest Component
Rest Component
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
 
Integration of mule esb with microsoft azure
Integration of mule esb with microsoft azureIntegration of mule esb with microsoft azure
Integration of mule esb with microsoft azure
 
Not Filter
Not FilterNot Filter
Not Filter
 

Recently uploaded

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 

Recently uploaded (20)

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

Bean as Datasource

  • 1.
  • 2.  The main motto of this PPT is How to use Bean as Datasource in Database connector in our applications.
  • 3.  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.
  • 4.
  • 5. .mflow <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:http="http://www.mulesoft.org/schema/mule/http" 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.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd"> <spring:beans> <spring:bean id="Bean1" name="Bean" class="org.enhydra.jdbc.standard.StandardDataSource"> <spring:property name="driverName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> <spring:property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=test1;user=*****;password=******"/> </spring:bean> </spring:beans> <jdbc-ee:connector name="Database" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database" dataSource-ref="Bean1"/> <context:property-placeholder location="file:${mule_home}/conf/esb-ecomm-details.properties,file:${mule_home}/conf/esb-soa-vmes- db.properties,file:${mule_home}/conf/esb-ecom-sf-query-details.properties,file:${mule_home}/conf/esb-ecom- error.properties,file:${mule_home}/conf/esb-vpdm-details.properties"/> <flow name="DataBase_BeanFlow1" doc:name="DataBase_BeanFlow1"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8089" doc:name="HTTP" path="dbtest"/> <logger message="--entered" level="INFO" doc:name="Logger"/> <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-ref="Database" doc:name="Database"> <jdbc-ee:query key="select" value="select * from mytable"/> </jdbc-ee:outbound-endpoint> <logger message="--after db--#[payload]" level="INFO" doc:name="Logger"/> </flow> </mule>
  • 6.  Output:  INFO 2015-12-12 05:49:03,286 [main] org.mule.DefaultMuleContext:  **********************************************************************  * Application: database_bean *  * OS encoding: Cp1252, Mule encoding: UTF-8 *  * *  * Agents Running: *  * Clustering Agent *  * JMX Agent *  **********************************************************************  INFO 2015-12-12 05:49:03,288 [main] org.mule.module.launcher.MuleDeploymentService:  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++  + Started app 'database_bean' +  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++  INFO 2015-12-12 05:49:42,464 [[database_bean].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --entered  INFO 2015-12-12 05:49:42,473 [[database_bean].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Database.dispatcher.543460185'. Object is: EEJdbcMessageDispatcher  INFO 2015-12-12 05:49:42,474 [[database_bean].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Database.dispatcher.543460185'. Object is: EEJdbcMessageDispatcher  INFO 2015-12-12 05:49:42,770 [[database_bean].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --after db--[{subj=Hindi, marks=55, name=Ramesh, id=1}, {subj=English, marks=65, name=Mahesh, id=2}, {subj=science, marks=75, name=Pavan, id=3}, {subj=social, marks=45, name=Siva, id=4}]
  • 7.  Flow of execution: 1. URL to trigger the service from browser http://localhost:8089/dbtest 2. Database component connects to the specific database, executes the select query and prints the result