# tHiveClose

Closes connection to a Hive database.

tHiveClose closes an active connection to a database.

This component is not shipped with your Talend Studio by default. You need to install it using the Feature Manager. For more information, see [Installing features using the Feature Manager](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/install-features-to-talend-studio).

## tHiveClose Standard properties

These properties are used to configure tHiveClose running in the Standard Job framework.

The Standard tHiveClose component belongs to the Big Data and the Databases families.

The component in this framework is available in all Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| Component list | If there is more than one connection used in the Job, select<br>tHiveConnection from the<br>list. |

## Advanced settings

| Properties | Description |
| --- | --- |
| tStatCatcher Statistics | Select this check box to collect the log data at a component<br>level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is to be used along with other Hive components,<br>especially with tHiveConnection as<br>tHiveConnection allows you to<br>open a connection for the transaction which is underway. |
| Dynamic settings | Click the [+] button to add a row in the table<br>and fill the Code field with a context<br>variable to choose your database connection dynamically from multiple<br>connections planned in your Job. This feature is useful when you need to<br>access database tables having the same data structure but in different<br>databases, especially when you are working in an environment where you<br>cannot change your Job settings, for example, when your Job has to be<br>deployed and executed independent of Talend Studio.<br><br>Once a dynamic parameter is defined, the Component List box in the Basic<br>settings view becomes unusable.<br><br>For examples on using dynamic parameters, see [Reading data from databases through<br>context-based dynamic connections](https://help.qlik.com/talend/r/en-US/8.0/components/defining-context-groups/reading-data-from-databases-through-context-based-dynamic-connections) and [Reading data from different MySQL databases<br>using dynamically loaded connection parameters](https://help.qlik.com/talend/r/en-US/8.0/components/context/reading-data-from-different-mysql-databases-using-dynamically-loaded-connection-parameters). For more information on<br>Dynamic settings and context variables, see<br>[Dynamic schema](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/dynamic-schema) and [Creating a context group and define context<br>variables in it](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/creating-context-group-and-define-context-variables-in-it). |
| Prerequisites | The Hadoop distribution must be properly installed, so as to guarantee the interaction<br>with *Talend Studio*. The following list presents MapR related information for<br>example.<br><br><ul> <li> <p>Ensure that you have installed the MapR client in the machine where                  <span>Talend Studio</span> is,               and added the MapR client library to the PATH variable of that machine. According to               MapR's documentation, the library or libraries of a MapR client corresponding to each               OS version can be found under <em>MAPR_INSTALL\                  hadoop\hadoop-VERSION\lib\native</em>. For example, the library for Windows is <em>\lib\native\MapRClient.dll</em> in the MapR client jar file.</p> <p>Without adding the specified library or libraries, you may encounter the following				error: <span>no MapRClient in java.library.path</span>.</p> </li> <li> <p>Set the <span>-Djava.library.path</span> argument,               for example, in the <span>Job Run VM arguments</span> area               of the <span>Run/Debug</span> view in the <span>Preferences</span> dialog box in the <span>Window</span> menu. This argument provides to <span>Talend Studio</span> the               path to the native library of that MapR client. This allows the subscription-based               users to make full use of the <span>Data viewer</span> to               view locally in <span>Talend Studio</span> the               data stored in MapR.</p> </li> </ul><br><br>For further information about how to install a Hadoop distribution, see the manuals<br>corresponding to the Hadoop distribution you are using. |