Database Connector

The Database connector establishes communication between your Mule app and a relational database. In Studio, you need to add the Database connector as described in To Add a Connector to Studio. After adding the connector to Studio, the connector and its operations appear in the Mule Palette.

Database Listeners and Operations

The Database connector provides a listener to read from a database in the Source section of a flow. Other operations also allow you to read and write to a database anywhere in the Process section. Instead of writing single records to a database, bulk operations allow you to modify a collection of records by simply supplying the SQL to modify each record. Other operations allow you to carry out Data Definition Language (DDL) operations, to execute stored procedures, or to execute entire SQL scripts at once.

Database Connector Features

  • Improved operations: Operations are streamlined to make it easier to interface with a database, either with single or bulk operations.

  • Dynamic queries are easy: There is a single experience for executing static and dynamic queries.

  • Embeddable transformations: You can embed DataWeave transformations inside the Insert and Update operations to construct the data sets that you want to send to the database without a side effect on the message or the need to use enrichers.

  • Streaming support: The connector uses Mule’s streaming framework to handle streaming automatically and transparently. You can even execute a Select statement and process the results asynchronously without worrying about leaking connections.

Supported Database Types

The Database Connector provides specialized support for the following database:

  • Derby

  • MySQL

  • Oracle

  • Microsoft SQL Server

You can set up other JDBC databases using a generic JDBC configuration. You can also reference a JDBC DataSource object or a XADataSource object, which is required for XA transactions. You typically create the object in Studio using Spring.