Contact Us 1-800-596-4880

Database Connector Reference

This page covers the Database connector configuration parameters.

Select

Selects data from a database.

Attributes of <select…​>

Name Description

config-ref

Defines the configuration parameters for the JDBC connection.

  • Type: string

  • Required: no

  • Default: none

source

The expression used to obtain the value used to calculate parameters. Default is empty, so parameters are calculated from the payload.

  • Type: string

  • Required: no

  • Default: none

target

The enricher expression used to enrich the current message with the result of the SQL processing.

  • Type: string

  • Required: no

  • Default: #[payload]

transactionalAction

Indicates how the message processor handles transactions.

  • Type: transactionalActionType

  • Required: no

  • Default: JOIN_IF_POSSIBLE

streaming

Indicates if result sets must be returned as an iterator or as a list of maps.

  • Type: boolean

  • Required: no

  • Default: false

fetchSize

Indicates how many rows to fetch from the database when rows are read from a resultSet. This property is required when streaming is true; in that case a default value (10) is used.

  • Type: integer

  • Required: no

  • Default: none

maxRows

Sets the limit for the maximum number of rows that any ResultSet object generated by this message processor can contain for the given number. If the limit is exceeded, the excess rows are silently dropped.

  • Type: integer

  • Required: no

  • Default: none

queryTimeout

Indicates the minimum amount of time (in seconds) before the connector will attempt to cancel a running query. No timeout is used by default.

  • Type: integer

  • Required: no

  • Default: none

Child Elements of <select…​>

Name Cardinality Description

dynamic-query

0..1

template-query-ref

0..1

in-param

0..*

parameterized-query

0..1

in-param

0..1

abstractQueryResultSetHandler

0..1

Update

Updates data in a database.

Attributes of <update…​>

Name Description

config-ref

Defines the configuration parameters for the JDBC connection.

  • Type: string

  • Required: no

  • Default: none

source

The expression used to obtain the value used to calculate parameters. Default is empty, so parameters are calculated from the payload.

  • Type: string

  • Required: no

  • Default: none

target

The enricher expression used to enrich the current message with the result of the SQL processing.

  • Type: string

  • Required: no

  • Default: #[payload]

transactionalAction

Indicates how the message processor handles transactions.

  • Type: transactionalActionType

  • Required: no

  • Default: JOIN_IF_POSSIBLE

bulkMode

Indicates whether or not a bulk update is requested. When true, payload is required to be a collection and a bulk update executes for each item in the collection. Note: This attribute cannot be set dynamically through a MEL expression.

  • Type: boolean

  • Required: no

  • Default: false

queryTimeout

Indicates the minimum amount of time (in seconds) before the connector attempts to cancel a running query. No timeout is used by default.

  • Type: integer

  • Required: no

  • Default: none

Child Elements of <update…​>

Name Cardinality Description

dynamic-query

0..1

template-query-ref

0..1

in-param

0..*

parameterized-query

0..1

in-param

0..1

Delete

Deletes data from a database.

Attributes of <delete…​>

Name Description

config-ref

Defines the configuration parameters for the JDBC connection.

  • Type: string

  • Required: no

  • Default: none

source

The expression used to obtain the value used to calculate parameters. Default is empty, so parameters are calculated from the payload.

  • Type: string

  • Required: no

  • Default: none

target

The enricher expression used to enrich the current message with the result of the SQL processing.

  • Type: string

  • Required: no

  • Default: #[payload]

transactionalAction

Indicates how the message processor handles transactions.

  • Type: transactionalActionType

  • Required: no

  • Default: JOIN_IF_POSSIBLE

bulkMode

Indicates whether or not a bulk update is requested. When true, payload is required to be a collection and a bulk update executes for each item in the collection. Note: This attribute cannot be set dynamically through a MEL expression.

  • Type: boolean

  • Required: no

  • Default: false

queryTimeout

Indicates the minimum amount of time (in seconds) before the connector will attempt to cancel a running query. No timeout is used by default.

  • Type: integer

  • Required: no

  • Default: none

Child Elements of <delete…​>

Name Cardinality Description

dynamic-query

0..1

template-query-ref

0..1

in-param

0..*

parameterized-query

0..1

in-param

0..1

Insert

Inserts data into a database.

Attributes of <insert…​>

Name Description

config-ref

Defines the configuration parameters for the JDBC connection.

  • Type: string

  • Required: no

  • Default: none

source

The expression used to obtain the value used to calculate parameters. Default is empty, so parameters are calculated from the payload.

  • Type: string

  • Required: no

  • Default: none

target

The enricher expression used to enrich the current message with the result of the SQL processing.

  • Type: string

  • Required: no

  • Default: #[payload]

transactionalAction

Indicates how the message processor handles transactions.

  • Type: transactionalActionType

  • Required: no

  • Default: JOIN_IF_POSSIBLE

bulkMode

Indicates whether or not a bulk update is requested. When true, payload is required to be a collection and a bulk update executes for each item in the collection. Note: This attribute cannot be set dynamically through a MEL expression.

  • Type: boolean

  • Required: no

  • Default: false

autoGeneratedKeys

Indicates when to make auto-generated keys available for retrieval.

  • Type: boolean

  • Required: no

  • Default: false

autoGeneratedKeysColumnIndexes

Comma-separated list of column indexes that indicates which auto-generated keys to make available for retrieval.

  • Type: string

  • Required: no

  • Default: none

autoGeneratedKeysColumnNames

Comma separated list of column names that indicates which auto-generated keys should be made available for retrieval.

  • Type: string

  • Required: no

  • Default: none

queryTimeout

Indicates the minimum amount of time (in seconds) before the connector will attempt to cancel a running query. No timeout is used by default.

  • Type: integer

  • Required: no

  • Default: none

Child Elements of <insert…​>

Name Cardinality Description

dynamic-query

0..1

template-query-ref

0..1

in-param

0..*

parameterized-query

0..1

in-param

0..1

Execute DDL

Enables execution of DDL queries against a database.

Attributes of <execute-ddl…​>

Name Description

config-ref

Defines the configuration parameters for the JDBC connection.

  • Type: string

  • Required: no

  • Default: none

source

The expression used to obtain the value used to calculate parameters. Default is empty, so parameters are calculated from the payload.

  • Type: string

  • Required: no

  • Default: none

target

The enricher expression used to enrich the current message with the result of the SQL processing.

  • Type: string

  • Required: no

  • Default: #[payload]

transactionalAction

Indicates how the message processor handles transactions.

  • Type: transactionalActionType

  • Required: no

  • Default: JOIN_IF_POSSIBLE

queryTimeout

Indicates the minimum amount of time (in seconds) before the connector will attempt to cancel a running query. No timeout is used by default.

  • Type: integer

  • Required: no

  • Default: none

Child Elements of <execute-ddl…​>

Name

Cardinality

Description

dynamic-query

1..1

Bulk Execute

Updates data in a database.

Attributes of <bulk-execute…​>

Name Description

config-ref

Defines the configuration parameters for the JDBC connection.

  • Type: string

  • Required: no

  • Default: none

source

The expression used to obtain the value used to calculate parameters. Default is empty, so parameters are calculated from the payload.

  • Type: string

  • Required: no

  • Default: none

target

The enricher expression used to enrich the current message with the result of the SQL processing.

  • Type: string

  • Required: no

  • Default: #[payload]

transactionalAction

Indicates how the message processor handles transactions.

  • Type: transactionalActionType

  • Required: no

  • Default: JOIN_IF_POSSIBLE

file

The location of a file to load. The file can point to a resource on the classpath or on a disk.

  • Type: string

  • Required: no

  • Default: none

queryTimeout

Indicates the minimum amount of time (in seconds) before the connector will attempt to cancel a running query. No timeout is used by default.

  • Type: integer

  • Required: no

  • Default: none

Stored Procedure

Executes a SQL statement in a database.

Attributes of <stored-procedure…​>

Name Description

config-ref

Defines the configuration parameters for the JDBC connection.

  • Type: string

  • Required: no

  • Default: none

source

The expression used to obtain the value used to calculate parameters. Default is empty, so parameters are calculated from the payload.

  • Type: string

  • Required: no

  • Default: none

target

The enricher expression used to enrich the current message with the result of the SQL processing.

  • Type: string

  • Required: no

  • Default: #[payload]

transactionalAction

Indicates how the message processor handles transactions.

  • Type: transactionalActionType

  • Required: no

  • Default: JOIN_IF_POSSIBLE

streaming

Indicates if result sets must be returned as an iterator or as list of maps.

  • Type: boolean

  • Required: no

  • Default: false

fetchSize

Indicates how many rows to fetch from the database when rows are read from a resultSet. This property is required when streaming is true; in that case a default value (10) is used.

  • Type: integer

  • Required: no

  • Default: none

maxRows

Sets the limit for the maximum number of rows that any ResultSet object generated by this message processor can contain for the given number. If the limit is exceeded, the excess rows are silently dropped.

  • Type: integer

  • Required: no

  • Default: none

autoGeneratedKeys

Indicates when to make auto-generated keys available for retrieval.

  • Type: boolean

  • Required: no

  • Default: false

autoGeneratedKeysColumnIndexes

Comma-separated list of column indexes that indicates which auto-generated keys to make available for retrieval.

  • Type: string

  • Required: no

  • Default: none

autoGeneratedKeysColumnNames

Comma separated list of column names that indicates which auto-generated keys should be made available for retrieval.

  • Type: string

  • Required: no

  • Default: none

queryTimeout

Indicates the minimum amount of time (in seconds) before the connector will attempt to cancel a running query. No timeout is used by default.

  • Type: integer

  • Required: no

  • Default: none

Child Elements of <stored-procedure…​>

Name Cardinality Description

dynamic-query

0..1

template-query-ref

0..1

in-param

0..*

parameterized-query

0..1

in-param

0..1

out-param

0..1

inout-param

0..1

Template Query

Attributes of <template-query…​>

Name Description

name

Identifies the query so that other elements can reference it.

  • Type: string (must have no spaces)

  • Required: yes

  • Default: none

Child Elements of <template-query…​>

name Cardinality Description

dynamic-query

1..1

parameterized-query

1..1

in-param

0..*

template-query-ref

1..1

in-param

1..*

Connection Properties

Specifies a list of custom key-value connection properties for the database connector configuration. (Supports MEL expressions)

Child Elements of <connection-properties…​>

Name Cardinality Description

property

1..*

JDBC User-Defined Data Types (UDT)

Specify a user-defined JDBC data type to be used when passing one to a stored procedure call. If you need to use a UDT in a stored procedure, specify the data type in the database configuration in a child element <db:data-type> of the parent element <db:data-types>. The user-defined data type parameter name (name) and type id (id) must be specified as in the example below, and as a parameter of the stored procedure you call.

JDBC type STRUCT is cast to a mapped Java class. There is no cast for a Java array to an SQL ARRAY.

Child Elements of <data-types…​>

Name Cardinality Description

data-type

1..*

Requires a name that is a user-defined reference to a JDBC data type, and the integer specifier id for the data type.

<data-types> Example

<db:oracle-config name="Oracle_Configuration" url="jdbc:oracle:thin:@54.175.245.218:1581:xe" user="user" password="4321" >
        <db:data-types>
            <db:data-type name="T_DEMO_OBJECTS" id="2003"/>
            <db:data-type name="T_DEMO_OBJECT" id="2002" />
        </db:data-types>
    </db:oracle-config>
JDBC Data Type Code id

ARRAY

2003

BIGINT

-5

BINARY

-2

BIT

-7

BLOB

2004

BOOLEAN

16

CHAR

1

CLOB

2005

DATALINK

70

DATE

91

DECIMAL

3

DISTINCT

2001

DOUBLE

8

FLOAT

6

INTEGER

4

JAVA_OBJECT

2000

LONGNVARCHAR

-16

LONGVARBINARY

-4

LONGVARCHAR

-1

NCHAR

-15

NCLOB

2011

NULL

0

NUMERIC

2

NVARCHAR

-9

OTHER

1111

REAL

7

REF

2006

REF_CURSOR

2012

ROWID

-8

SMALLINT

5

SQLXML

2009

STRUCT

2002

TIME

92

TIME_WITH_TIMEZONE

2013

TIMESTAMP

93

TIMESTAMP_WITH_TIMEZONE

2014

TINYINT

-6

VARBINARY

-3

VARCHAR

12

Attributes of <data-type…​>

Name Description

name

Reference to the JDBC type

  • Type: string

  • Required: yes

  • Default: none

id

identifier for the data type as specified in the class for JDBC data types java.sql.Types

  • Type: int

  • Required: yes

  • Default: none

Pooling Profile

Provides a way to configure database connection pooling.

Attributes of <pooling-profile…​>

Name Description

maxPoolSize

Maximum number of connections a pool maintains at any given time.

  • Type: integer

  • Required: no

  • Default: none

minPoolSize

Minimum number of connections a pool maintains at any given time.

  • Type: integer

  • Required: no

  • Default: none

acquireIncrement

Determines how many connections at a time to try to acquire when the pool is exhausted.

  • Type: integer

  • Required: no

  • Default: none

preparedStatementCacheSize

Determines how many statements are cached per pooled connection. If changed to 0, statement caching is disabled.

  • Type: integer

  • Required: no

  • Default: 5

maxWaitMillis

The number of milliseconds a client calling getConnection() waits for a connection to be checked-in or acquired when the pool is exhausted. Zero means wait indefinitely.

  • Type: string

  • Required: no

  • Default: none

Generic Config

Provides a way to define a JDBC configuration for any DB vendor.

Attributes of <generic-config…​>

Name Description

name

Identifies the database configuration so other elements can reference it.

  • Type: string (no spaces)

  • Required: yes

  • Default: none

dataSource-ref

Reference to a JDBC DataSource object. This object is typically created using Spring. When using XA transactions, an XADataSource object must be provided.

  • Type: string

  • Required: no

  • Default: none

url

URL used to connect to the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

useXaTransactions

Indicates whether or not the created datasource has to support XA transactions. Default is false.

  • Type: boolean

  • Required: no

  • Default: false

driverClassName

Fully-qualified name of the database driver class. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

connectionTimeout

Maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout.

  • Type: int

  • Required: no

  • Default: none

transactionIsolation

The transaction isolation level to set on the driver when connecting the database.

  • Type: enumeration

  • Required: no

  • Default: none

Child Elements of <generic-config…​>

Name Cardinality Description

pooling-profile

0..1

Provides a way to configure database connection pooling.

connection-properties

0..1

Specifies a list of custom key-value connectionProperties for the config. Supports MEL expressions.

data-types

0..1

Specifies non-standard custom data types.

mule:abstract-reconnection-strategy

0..1

Derby Config

Attributes of <derby-config…​>

Name Description

name

Identifies the database configuration so other elements can reference it.

  • Type: string (no spaces)

  • Required: yes

  • Default: none

dataSource-ref

Reference to a JDBC DataSource object. This object is typically created using Spring. When using XA transactions, an XADataSource object must be provided.

  • Type: string

  • Required: no

  • Default: none

url

URL used to connect to the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

useXaTransactions

Indicates whether or not the created datasource has to support XA transactions. Default is false.

  • Type: boolean

  • Required: no

  • Default: false

driverClassName

Fully-qualified name of the database driver class. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

connectionTimeout

Maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout.

  • Type: int

  • Required: no

  • Default: none

transactionIsolation

The transaction isolation level to set on the driver when connecting the database.

  • Type: enumeration

  • Required: no

  • Default: none

user

The user that is used for authentication against the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

password

The password that is used for authentication against the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

Child Elements of <derby-config…​>

Name Cardinality Description

pooling-profile

0..1

Provides a way to configure database connection pooling.

connection-properties

0..1

Specifies a list of custom key-value connectionProperties for the config. Supports MEL expressions.

data-types

0..1

Specifies non-standard custom data types.

mule:abstract-reconnection-strategy

0..1

Oracle Config

Attributes of <oracle-config…​>

Name Description

name

Identifies the database configuration so other elements can reference it.

  • Type: string (no spaces)

  • Required: yes

  • Default: none

dataSource-ref

Reference to a JDBC DataSource object. This object is typically created using Spring. When using XA transactions, an XADataSource object must be provided.

  • Type: string

  • Required: no

  • Default: none

url

URL used to connect to the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

useXaTransactions

Indicates whether or not the created datasource has to support XA transactions. Default is false.

  • Type: boolean

  • Required: no

  • Default: false

driverClassName

Fully-qualified name of the database driver class. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

connectionTimeout

Maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout.

  • Type: int

  • Required: no

  • Default: none

transactionIsolation

The transaction isolation level to set on the driver when connecting the database.

  • Type: enumeration

  • Required: no

  • Default: none

user

The user that is used for authentication against the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

password

The password that is used for authentication against the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

host

Configures just the host part of the JDBC URL (and leaves the rest of the default JDBC URL untouched). Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

port

Configures just the port part of the JDBC URL (and leaves the rest of the default JDBC URL untouched).

  • Type: integer

  • Required: no

  • Default: none

instance

Configures just the instance part of the JDBC URL (and leaves the rest of the default JDBC URL untouched). Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

Child Elements of <oracle-config…​>

Name Cardinality Description

pooling-profile

0..1

Provides a way to configure database connection pooling.

connection-properties

0..1

Specifies a list of custom key-value connectionProperties for the config. Supports MEL expressions.

data-types

0..1

Specifies non-standard custom data types.

mule:abstract-reconnection-strategy

0..1

MySQL Config

Attributes of <mysql-config…​>

Name Description

name

Identifies the database configuration so other elements can reference it.

  • Type: string (no spaces)

  • Required: yes

  • Default: none

dataSource-ref

Reference to a JDBC DataSource object. This object is typically created using Spring. When using XA transactions, an XADataSource object must be provided.

  • Type: string

  • Required: no

  • Default: none

url

URL used to connect to the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

useXaTransactions

Indicates whether or not the created datasource has to support XA transactions. Default is false.

  • Type: boolean

  • Required: no

  • Default: false

driverClassName

Fully-qualified name of the database driver class. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

loginTimeout

Maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout.

  • Type: int

  • Required: no

  • Default: none

transactionIsolation

The transaction isolation level to set on the driver when connecting the database.

  • Type: enumeration

  • Required: no

  • Default: none

user

The user that is used for authentication against the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

password

The password that is used for authentication against the database. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

database

The name of the database. Must be configured unless a full JDBC URL is configured. Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

host

Configures just the host part of the JDBC URL (and leaves the rest of the default JDBC URL untouched). Supports MEL expressions.

  • Type: string

  • Required: no

  • Default: none

port

Configures just the port part of the JDBC URL (and leaves the rest of the default JDBC URL untouched).

  • Type: integer

  • Required: no

  • Default: none

Child Elements of <mysql-config…​>

Name Cardinality Description

pooling-profile

0..1

Provides a way to configure database connection pooling.

connection-properties

0..1

Specifies a list of custom key-value connectionProperties for the config. Supports MEL expressions.

data-types

0..1

Specifies non-standard custom data types.

mule:abstract-reconnection-strategy

0..1

SQL Server Config

To configure access to SQL Server Configuration use the Generic Configuration of the Database Connector. See the Generic Config for configuring Transaction properties and Connection Pooling properties.

Download the Microsoft JDBC driver if you do not have it.

Attributes of <generic-config…​>

Name Type Required Default Description

name

name (no spaces)

yes

Identifies the database configuration so other elements can reference it.

url

string

no

URL used to connect to the database. Supports MEL expressions. Example: jdbc:sqlserver://${db.host};database=${db.database};user=${db.user};password=${db.password}

driverClassName

string

no

Fully-qualified name of the database driver class. Supports MEL expressions. Example: com.microsoft.sqlserver.jdbc.SQLServerDriver

Using Integrated Security

If you want to make use of the integrated security login feature when using the Database Connector with your Microsoft SQL instance, you need to perform some additional steps:

  1. Configure the native libraries location inside the JDBC driver (sqljdbc4.jar).

    • Right click on your project name in Package Explorer

    • Click Build Path

    • Click Configure Build Path

    • Select sqljdbc4.jar

    • Select the child element Native Library Location (None)

    • Press the Edit…​ button

    • Select the folder that contains the sqljdbc_auth.dll native library.

    • Click Ok to confirm the changes.

  2. You also need to add integratedSecurity=true to your connection URL. The line should look like the following string:

    • jdbc:sqlserver://${db.host};database=${db.database};integratedSecurity=true

In Param

Attributes of <in-param…​>

Name Description

name

The name of the input parameter.

  • Type: string

  • Required: yes

  • Default: none

value

The value of the parameter.

  • Type: string

  • Required: yes

  • Default: none

type

Parameter type name.

  • Type: ExtendedJdbcDataTypes

  • Required: no

  • Default: none

Out Param

Attributes of <out-param…​>

Name Description

name

The name of the output parameter.

  • Type: string

  • Required: yes

  • Default: none

type

Parameter type name.

  • Type: ExtendedJdbcDataTypes

  • Required: no

  • Default: none

Inout Param

Attributes of <inout-param…​>

Name Description

name

The name of the output parameter.

  • Type: string

  • Required: yes

  • Default: none

value

The value of the parameter.

  • Type: string

  • Required: yes

  • Default: none

type

Parameter type name.

  • Type: ExtendedJdbcDataTypes

  • Required: no

  • Default: none

See Also

View on GitHub