Contact Free trial Login

Database Connector Data Types Reference - Mule 4

This topic includes information about database input parameters and defining custom data types you can use when connected to a particular connection provider.

Force Parameter Types

Although uncommon, at some point you might need to force the underlying JDBC driver to coerce an input parameter to an specific type. For example, if your JDBC driver cannot determine the type of the input, or a parameter is of a custom type, you might need to apply force by specifing the type of each input parameter:

<db:bulk-insert queryTimeout="0" queryTimeoutUnit="SECONDS">
     <db:sql>INSERT INTO PLANET(POSITION, NAME) VALUES (:position, :name)</db:sql>
         <db:parameter-type key="name" type="VARCHAR" />
         <db:parameter-type key="position" type="INTEGER" />

Define Custom Data Types

The Database Connector Reference describes exclusive and common parameters for each connection provider, such as Derby and Oracle. A child element of the connection provider element defines custom data types you can use when connected to a particular provider. For example:

<db:config name="dbConfig">
   <db:derby-connection url="jdbc:derby:muleEmbeddedDB;create=true">
           <!-- Derby uses JAVA_OBJECT for UDT-->
           <db:column-type typeName="CONTACT_DETAILS" id="2000"/>

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub