Configure Database Connector Data Types Examples | MuleSoft Documentation
# Configure Database Connector Data Types Examples
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:
Figure 1. Parameter Types field configuration
In the XML editor, the `<db:parameter-types>` configuration looks like this:
```
<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:
JDBC Data Type Code | id  
---|---  
JAVA_OBJECT  
LONGNVARCHAR  
LONGVARBINARY  
REF_CURSOR  
TIME_WITH_TIMEZONE  
TIMESTAMP_WITH_TIMEZONE  
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:
Figure 2. Column Types field configuration
In the XML editor, the `<db:column-type>` configuration looks like this:
```
<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
  * MuleSoft Help Center