---
schema_version: "1"
id: a5b39c90b5c973d44cdd38fdac00a3d25c83f6fa5e0bbad9fb90f56139edaa97
title: Configure Database Connector Data Types Examples
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/db-connector/1.14/database-configure-data-types.md
canonical_url: https://docs.mulesoft.com/db-connector/1.14/database-configure-data-types
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8030309abc05eeb6bb4d71cccaba7ab26b8eec2b7024432fe55ab75d56a3d2b1
description: MuleSoft Documentation Site
release: "1.14"
latest: false
---
---
product: Database Connector
version: 1.14
---

# Configure Database Connector Data Types Examples

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The following examples show how to configure Anypoint Connector for Database (Database Connector)
data types by using the **Parameters types** field to specify the type of each input parameter in
the query and the **Column types** field to set custom data types when connected to a particular
database provider.

## Configure the Parameter Types Field in Studio

If your JDBC driver either cannot determine the type of the input, or a parameter is of a custom
type, configure the **Parameter types** field to specify the type of each input parameter. The
following example shows how to configure the **Parameter types** field in the **Bulk insert**
operation:

1.  In your Studio flow, select the **Bulk insert** operation.

2.  In the **General** tab of the operation configuration screen, click the plus sign (**+**) next
    to the **Connector configuration** field to access the global element configuration fields.

3.  Specify the database connection information and click **OK**.

4.  Set the **SQL Query Text** field to the SQL query to execute, for example:
    `INSERT INTO PLANET(POSITION, NAME) VALUES (:position, :name)`

5.  In the operation configuration screen, click the **Advanced** tab.

6.  Set the **Parameter types** field to `Edit inline`.

7.  Click the green plus sign (**+**) to create a new parameter type.

8.  In the parameter type window, set the **Key** field to `name` and the **Type** field to
    `VARCHAR`.

9.  Click **Finish**.

10. Repeat Step 7.

11. In the parameter type window, set the **Key** field to `position` and the **Type** field to
    `INTEGER`.

12. Click **Finish**.

The following screenshot shows the configuration in Studio:

![Set the Parameter types field to Edit Inline and then click the plus sign to create a new parameter](/mulesoft/current/en-us/db-connector/1.14/_images/database-parameter-types.png)

Figure 1. Parameter Types field configuration

In the XML editor, the `<db:parameter-types>` configuration looks like this:

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

## Configure the Column Types Field in Studio

Each connection provider uses exclusive and common parameters, such as Derby and Oracle. A child
element of the connection provider element defines custom data types parameters you can use when
connected to a particular provider.

The following table provides the JDBC Data Type codes and IDs that you can use to define custom data
types:

<table><colgroup><col> <col></colgroup><thead><tr><th>JDBC Data Type Code</th><th>id</th></tr></thead><tbody><tr><td><p>ARRAY</p></td><td><p>2003</p></td></tr><tr><td><p>BIGINT</p></td><td><p>-5</p></td></tr><tr><td><p>BINARY</p></td><td><p>-2</p></td></tr><tr><td><p>BIT</p></td><td><p>-7</p></td></tr><tr><td><p>BLOB</p></td><td><p>2004</p></td></tr><tr><td><p>BOOLEAN</p></td><td><p>16</p></td></tr><tr><td><p>CHAR</p></td><td><p>1</p></td></tr><tr><td><p>CLOB</p></td><td><p>2005</p></td></tr><tr><td><p>DATALINK</p></td><td><p>70</p></td></tr><tr><td><p>DATE</p></td><td><p>91</p></td></tr><tr><td><p>DECIMAL</p></td><td><p>3</p></td></tr><tr><td><p>DISTINCT</p></td><td><p>2001</p></td></tr><tr><td><p>DOUBLE</p></td><td><p>8</p></td></tr><tr><td><p>FLOAT</p></td><td><p>6</p></td></tr><tr><td><p>INTEGER</p></td><td><p>4</p></td></tr><tr><td><p>JAVA_OBJECT</p></td><td><p>2000</p></td></tr><tr><td><p>LONGNVARCHAR</p></td><td><p>-16</p></td></tr><tr><td><p>LONGVARBINARY</p></td><td><p>-4</p></td></tr><tr><td><p>LONGVARCHAR</p></td><td><p>-1</p></td></tr><tr><td><p>NCHAR</p></td><td><p>-15</p></td></tr><tr><td><p>NCLOB</p></td><td><p>2011</p></td></tr><tr><td><p>NULL</p></td><td><p>0</p></td></tr><tr><td><p>NUMERIC</p></td><td><p>2</p></td></tr><tr><td><p>NVARCHAR</p></td><td><p>-9</p></td></tr><tr><td><p>OTHER</p></td><td><p>1111</p></td></tr><tr><td><p>REAL</p></td><td><p>7</p></td></tr><tr><td><p>REF</p></td><td><p>2006</p></td></tr><tr><td><p>REF_CURSOR</p></td><td><p>2012</p></td></tr><tr><td><p>ROWID</p></td><td><p>-8</p></td></tr><tr><td><p>SMALLINT</p></td><td><p>5</p></td></tr><tr><td><p>SQLXML</p></td><td><p>2009</p></td></tr><tr><td><p>STRUCT</p></td><td><p>2002</p></td></tr><tr><td><p>TIME</p></td><td><p>92</p></td></tr><tr><td><p>TIME_WITH_TIMEZONE</p></td><td><p>2013</p></td></tr><tr><td><p>TIMESTAMP</p></td><td><p>93</p></td></tr><tr><td><p>TIMESTAMP_WITH_TIMEZONE</p></td><td><p>2014</p></td></tr><tr><td><p>TINYINT</p></td><td><p>-6</p></td></tr><tr><td><p>VARBINARY</p></td><td><p>-3</p></td></tr><tr><td><p>VARCHAR</p></td><td><p>12</p></td></tr></tbody></table>

The following example shows how to configure the **Column types** field in the Derby global
configuration connection element:

1.  In Studio, navigate to the **Global Elements** tab.

2.  Click **Create**.

3.  In the **Global Type** window, filter by typing `database`.

4.  Select **Database Config** and click **OK**.

5.  Set the **Connection** field to `Derby Connection`.

6.  Configure the required libraries for the Derby JDBC Driver and the additional connection fields.

7.  Click the **Advanced** tab.

8.  Set the **Column types** field to `Edit inline`.

9.  Click the green plus sign (**+**) to create a custom column type.

10. In the parameter type window, set the **Id** field to `2000` and the **Type** field to
    `CONTACT_DETAILS`.

11. Click **Finish**.

The following screenshot shows the configuration in Studio:

![Set the Column types field to edit inline and then click the plus sign to create a column type](/mulesoft/current/en-us/db-connector/1.14/_images/database-column-types.png)

Figure 2. Column Types field configuration

In the XML editor, the `<db:column-type>` configuration looks like this:

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

## See Also

- [Database Connector Examples](https://docs.mulesoft.com/db-connector/1.14/database-connector-examples)

- [Salesforce Help](https://help.salesforce.com)
