SlideShare a Scribd company logo
Mule ESB – Connecting to
Microsoft SQL server DB
GENERIC DB CONFIGURATION
Mule ESB provides out-of-the-box support to connect to Oracle, MySQL and Derby DB.
To connect to MS SQL server DB, we need to follow additional steps. Let us see what are the different
ways to connect to this DB.
Pre-requisites:
1. Anypoint Studio version 6x
2. Mule runtime version 3.7 or above
3. Microsoft SQL server version 2012
4. sqljdbc4 jar
5. sqljdbc_auth dll file.
 There are two ways to connect to MS SQL server DB from Mule ESB.
1. Windows Authentication
This requires server name, windows credentials, JAR and the DLL files to
connect to the DB.
2. Basic Authentication
This type of connection requires server, port, DB name, login credentials and
the JAR file.
Using Windows authentication
 Add the sqljdbc4 JAR in the Java build path of the project.
 Expand this JAR in the build path, click on Native library location and edit.
 Give the path of sqljdbc_auth DLL file from workspace.
 Make sure you are placing the correct DLL file as it is different for 32 bit and 64
bit operating systems.
Mule esb – connecting to ms sql db
Using Windows authentication
 In the application xml, create a new global element.
 Create a new Generic Database Configuration.
 We can give either spring bean or database URL.
 For DB URL enter
jdbc:sqlserver://${mssql.server};user=${mssql.user};password=${mssql.password};inte
gratedSecurity=true
 For Driver Class Name enter
com.microsoft.sqlserver.jdbc.SQLServerDriver
 Property Placeholder can be created to store connection properties.
 Use Test Connection to see if you are able to connect to DB.
Using Basic Authentication
 Add the sqljdbc4 JAR in the Java build path of the project.
 Enter URL as
"jdbc:sqlserver://${mssql.server}:${mssql.port};databaseName=${mssql.database};user=${
mssql.user};password=${mssql.password}"
 Enter Driver class Name as
com.microsoft.sqlserver.jdbc.SQLServerDriver
 Property Placeholder can be created to store connection properties.
 Use Test Connection to see if you are able to connect to DB.
 Drag and drop the Database connector from palette to your flow.
 In DB connector, select the DB configuration we created.
 In Operation, select the type of query you need to run.
 For Parameterized query, enter the query.
 Invoke the flow and you should get the desired result.
Thank you
 For any questions, please add comments.
Ad

More Related Content

What's hot (20)

JavaScript
JavaScriptJavaScript
JavaScript
Sunil OS
 
Entity Framework Core & Micro-Orms with Asp.Net Core
Entity Framework Core & Micro-Orms with Asp.Net CoreEntity Framework Core & Micro-Orms with Asp.Net Core
Entity Framework Core & Micro-Orms with Asp.Net Core
Stephane Belkheraz
 
Jquery Basics
Jquery BasicsJquery Basics
Jquery Basics
Umeshwaran V
 
MongoDB & NoSQL 101
 MongoDB & NoSQL 101 MongoDB & NoSQL 101
MongoDB & NoSQL 101
Jollen Chen
 
Using database in android
Using database in androidUsing database in android
Using database in android
University of Potsdam
 
Introduction to jOOQ
Introduction to jOOQIntroduction to jOOQ
Introduction to jOOQ
Gonzalo Ortiz Jaureguizar
 
SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...
SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...
SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...
Sencha
 
Workshop 8: Templating: Handlebars, DustJS
Workshop 8: Templating: Handlebars, DustJSWorkshop 8: Templating: Handlebars, DustJS
Workshop 8: Templating: Handlebars, DustJS
Visual Engineering
 
Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W
WO Community
 
Sprout core and performance
Sprout core and performanceSprout core and performance
Sprout core and performance
Yehuda Katz
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Rabble .
 
Migrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan ManaloMigrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan Manalo
Promet Source
 
Migrating Drupal 7 to Drupal 8
Migrating Drupal 7 to Drupal 8Migrating Drupal 7 to Drupal 8
Migrating Drupal 7 to Drupal 8
Promet Source
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
Anis Ahmad
 
Intoduction on Playframework
Intoduction on PlayframeworkIntoduction on Playframework
Intoduction on Playframework
Knoldus Inc.
 
J query training
J query trainingJ query training
J query training
FIS - Fidelity Information Services
 
J query1
J query1J query1
J query1
Manav Prasad
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
Sunil OS
 
Brief introduction of Slick
Brief introduction of SlickBrief introduction of Slick
Brief introduction of Slick
Knoldus Inc.
 
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant   SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
Sencha
 
JavaScript
JavaScriptJavaScript
JavaScript
Sunil OS
 
Entity Framework Core & Micro-Orms with Asp.Net Core
Entity Framework Core & Micro-Orms with Asp.Net CoreEntity Framework Core & Micro-Orms with Asp.Net Core
Entity Framework Core & Micro-Orms with Asp.Net Core
Stephane Belkheraz
 
MongoDB & NoSQL 101
 MongoDB & NoSQL 101 MongoDB & NoSQL 101
MongoDB & NoSQL 101
Jollen Chen
 
SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...
SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...
SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...
Sencha
 
Workshop 8: Templating: Handlebars, DustJS
Workshop 8: Templating: Handlebars, DustJSWorkshop 8: Templating: Handlebars, DustJS
Workshop 8: Templating: Handlebars, DustJS
Visual Engineering
 
Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W
WO Community
 
Sprout core and performance
Sprout core and performanceSprout core and performance
Sprout core and performance
Yehuda Katz
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007Introduction to Active Record - Silicon Valley Ruby Conference 2007
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Rabble .
 
Migrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan ManaloMigrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan Manalo
Promet Source
 
Migrating Drupal 7 to Drupal 8
Migrating Drupal 7 to Drupal 8Migrating Drupal 7 to Drupal 8
Migrating Drupal 7 to Drupal 8
Promet Source
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
Anis Ahmad
 
Intoduction on Playframework
Intoduction on PlayframeworkIntoduction on Playframework
Intoduction on Playframework
Knoldus Inc.
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
Sunil OS
 
Brief introduction of Slick
Brief introduction of SlickBrief introduction of Slick
Brief introduction of Slick
Knoldus Inc.
 
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant   SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
Sencha
 

Similar to Mule esb – connecting to ms sql db (20)

JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
 
Jdbc
Jdbc   Jdbc
Jdbc
Ishucs
 
Jdbc
JdbcJdbc
Jdbc
Ishucs
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
Prabhat gangwar
 
chapter 5 java.pptx
chapter 5  java.pptxchapter 5  java.pptx
chapter 5 java.pptx
BekiTube
 
Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3
IMC Institute
 
Chapter 5 JDBC.pdf for stufent of computer andtudent It s
Chapter 5 JDBC.pdf for stufent of computer andtudent  It sChapter 5 JDBC.pdf for stufent of computer andtudent  It s
Chapter 5 JDBC.pdf for stufent of computer andtudent It s
anuwaradisu19
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet Advanced
IMC Institute
 
Spring database - part2
Spring database -  part2Spring database -  part2
Spring database - part2
Santosh Kumar Kar
 
Chapter vii(accessing databases with jdbc)
Chapter vii(accessing databases with jdbc)Chapter vii(accessing databases with jdbc)
Chapter vii(accessing databases with jdbc)
Chhom Karath
 
Final Database Connectivity in JAVA.ppt
Final Database Connectivity in JAVA.pptFinal Database Connectivity in JAVA.ppt
Final Database Connectivity in JAVA.ppt
TabassumMaktum
 
Slide Latihan JDBC
Slide Latihan JDBCSlide Latihan JDBC
Slide Latihan JDBC
Bayu Rimba
 
JDBC.ppt
JDBC.pptJDBC.ppt
JDBC.ppt
ChagantiSahith
 
Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101
IDERA Software
 
Jdbc
JdbcJdbc
Jdbc
leminhvuong
 
Jdbc
JdbcJdbc
Jdbc
phanleson
 
jdbc_presentation.ppt
jdbc_presentation.pptjdbc_presentation.ppt
jdbc_presentation.ppt
DrMeenakshiS
 
Day2
Day2Day2
Day2
madamewoolf
 
Database Access in mule ESB
Database Access in mule ESBDatabase Access in mule ESB
Database Access in mule ESB
Srinu Prasad
 
JDBC PPT(4).pptx java Database Connectivity
JDBC PPT(4).pptx java Database ConnectivityJDBC PPT(4).pptx java Database Connectivity
JDBC PPT(4).pptx java Database Connectivity
dhanushoneplus00
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
 
chapter 5 java.pptx
chapter 5  java.pptxchapter 5  java.pptx
chapter 5 java.pptx
BekiTube
 
Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3
IMC Institute
 
Chapter 5 JDBC.pdf for stufent of computer andtudent It s
Chapter 5 JDBC.pdf for stufent of computer andtudent  It sChapter 5 JDBC.pdf for stufent of computer andtudent  It s
Chapter 5 JDBC.pdf for stufent of computer andtudent It s
anuwaradisu19
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet Advanced
IMC Institute
 
Chapter vii(accessing databases with jdbc)
Chapter vii(accessing databases with jdbc)Chapter vii(accessing databases with jdbc)
Chapter vii(accessing databases with jdbc)
Chhom Karath
 
Final Database Connectivity in JAVA.ppt
Final Database Connectivity in JAVA.pptFinal Database Connectivity in JAVA.ppt
Final Database Connectivity in JAVA.ppt
TabassumMaktum
 
Slide Latihan JDBC
Slide Latihan JDBCSlide Latihan JDBC
Slide Latihan JDBC
Bayu Rimba
 
Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101
IDERA Software
 
jdbc_presentation.ppt
jdbc_presentation.pptjdbc_presentation.ppt
jdbc_presentation.ppt
DrMeenakshiS
 
Database Access in mule ESB
Database Access in mule ESBDatabase Access in mule ESB
Database Access in mule ESB
Srinu Prasad
 
JDBC PPT(4).pptx java Database Connectivity
JDBC PPT(4).pptx java Database ConnectivityJDBC PPT(4).pptx java Database Connectivity
JDBC PPT(4).pptx java Database Connectivity
dhanushoneplus00
 
Ad

Recently uploaded (20)

FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Maximizing ROI with Odoo Staff Augmentation A Smarter Way to Scale
Maximizing ROI with Odoo Staff Augmentation  A Smarter Way to ScaleMaximizing ROI with Odoo Staff Augmentation  A Smarter Way to Scale
Maximizing ROI with Odoo Staff Augmentation A Smarter Way to Scale
SatishKumar2651
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Navigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdfNavigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdf
Applitools
 
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEMGDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
philipnathen82
 
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdfHow to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
victordsane
 
Solar-wind hybrid engery a system sustainable power
Solar-wind  hybrid engery a system sustainable powerSolar-wind  hybrid engery a system sustainable power
Solar-wind hybrid engery a system sustainable power
bhoomigowda12345
 
sequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineeringsequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineering
aashrithakondapalli8
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
The Elixir Developer - All Things Open
The Elixir Developer - All Things OpenThe Elixir Developer - All Things Open
The Elixir Developer - All Things Open
Carlo Gilmar Padilla Santana
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Implementing promises with typescripts, step by step
Implementing promises with typescripts, step by stepImplementing promises with typescripts, step by step
Implementing promises with typescripts, step by step
Ran Wahle
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Maximizing ROI with Odoo Staff Augmentation A Smarter Way to Scale
Maximizing ROI with Odoo Staff Augmentation  A Smarter Way to ScaleMaximizing ROI with Odoo Staff Augmentation  A Smarter Way to Scale
Maximizing ROI with Odoo Staff Augmentation A Smarter Way to Scale
SatishKumar2651
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Navigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdfNavigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdf
Applitools
 
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEMGDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
philipnathen82
 
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdfHow to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
victordsane
 
Solar-wind hybrid engery a system sustainable power
Solar-wind  hybrid engery a system sustainable powerSolar-wind  hybrid engery a system sustainable power
Solar-wind hybrid engery a system sustainable power
bhoomigowda12345
 
sequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineeringsequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineering
aashrithakondapalli8
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Implementing promises with typescripts, step by step
Implementing promises with typescripts, step by stepImplementing promises with typescripts, step by step
Implementing promises with typescripts, step by step
Ran Wahle
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Ad

Mule esb – connecting to ms sql db

  • 1. Mule ESB – Connecting to Microsoft SQL server DB GENERIC DB CONFIGURATION
  • 2. Mule ESB provides out-of-the-box support to connect to Oracle, MySQL and Derby DB. To connect to MS SQL server DB, we need to follow additional steps. Let us see what are the different ways to connect to this DB. Pre-requisites: 1. Anypoint Studio version 6x 2. Mule runtime version 3.7 or above 3. Microsoft SQL server version 2012 4. sqljdbc4 jar 5. sqljdbc_auth dll file.
  • 3.  There are two ways to connect to MS SQL server DB from Mule ESB. 1. Windows Authentication This requires server name, windows credentials, JAR and the DLL files to connect to the DB. 2. Basic Authentication This type of connection requires server, port, DB name, login credentials and the JAR file.
  • 4. Using Windows authentication  Add the sqljdbc4 JAR in the Java build path of the project.  Expand this JAR in the build path, click on Native library location and edit.  Give the path of sqljdbc_auth DLL file from workspace.  Make sure you are placing the correct DLL file as it is different for 32 bit and 64 bit operating systems.
  • 6. Using Windows authentication  In the application xml, create a new global element.  Create a new Generic Database Configuration.  We can give either spring bean or database URL.  For DB URL enter jdbc:sqlserver://${mssql.server};user=${mssql.user};password=${mssql.password};inte gratedSecurity=true  For Driver Class Name enter com.microsoft.sqlserver.jdbc.SQLServerDriver  Property Placeholder can be created to store connection properties.  Use Test Connection to see if you are able to connect to DB.
  • 7. Using Basic Authentication  Add the sqljdbc4 JAR in the Java build path of the project.  Enter URL as "jdbc:sqlserver://${mssql.server}:${mssql.port};databaseName=${mssql.database};user=${ mssql.user};password=${mssql.password}"  Enter Driver class Name as com.microsoft.sqlserver.jdbc.SQLServerDriver  Property Placeholder can be created to store connection properties.  Use Test Connection to see if you are able to connect to DB.
  • 8.  Drag and drop the Database connector from palette to your flow.  In DB connector, select the DB configuration we created.  In Operation, select the type of query you need to run.  For Parameterized query, enter the query.  Invoke the flow and you should get the desired result.
  • 9. Thank you  For any questions, please add comments.