# tSnowflakeConnection

Opens a connection to Snowflake that can then be reused by other Snowflake components.

Information noteNote:

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).

## tSnowflakeConnection Standard properties

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

The Standard tSnowflakeConnection component belongs to the Cloud family.

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

Information noteNote: This component is a specific version of a dynamic database connector. The properties related to database settings vary depending on your database type selection. For more information about dynamic database connectors, see [DB Generic components](https://help.qlik.com/talend/r/en-US/8.0/components/db-generic/db-generic-component).

## Basic settings

| Properties | Description |
| --- | --- |
| Database | Select the desired database type from the list and click<br>Apply. |
| Property Type | Select the way the connection details<br>will be set.<br><br><ul> <li> <p> <span>Built-In</span>: The connection details will be set                                locally for this component. You need to specify the values for all                                related connection properties manually.</p> </li> <li> <p> <span>Repository</span>: The connection details stored                                centrally in <span><span>Repository</span><abbr> &gt; </abbr><span>Metadata</span></span> will be reused by this component. </p> <p>You need to click                                the <span>[...]</span> button next to it and in the pop-up                                    <span>Repository Content</span> dialog box, select the                                connection details to be reused, and all related connection                                properties will be automatically filled in.</p> </li> </ul> |
| Account | In the Account field, enter, in double<br>quotation marks, the account name that has been assigned to you by Snowflake. |
| Authentication Type | Set the authentication type.<br><br><ul> <li> <p> <span>Basic</span>: Select this option if key pair                           authentication is not enabled. </p> </li> <li> <p> <span>Key Pair</span>: Select this option if key pair                           authentication is enabled.</p> <p>See <a href="https://docs.snowflake.net/manuals/user-guide/jdbc-configure.html#using-key-pair-authentication" target="_blank">Using Key Pair Authentication</a> for related                           information.</p> </li> <li> <p> <span>OAuth 2.0</span>: Select this option to use external                           OAuth for data accessing.</p> <p>See <a href="https://docs.snowflake.com/en/user-guide/oauth-ext-overview.html" target="_blank">External OAuth Overview</a> for related                           information.</p> </li> </ul><br><br>Information noteNote: Before selecting the Key<br>Pair option, make sure you have set the key pair authentication<br>data in the Basic settings view of the tSetKeystore<br>component as follows.<br><br><ol> <li>Leave the <span>TrustStore type</span> field unchanged.</li> <li>Set <span>TrustStore file</span> to                           <kbd>""</kbd>.</li> <li>Clear the <span>TrustStore password</span> field.</li> <li>Select <span>Need Client authentication</span>.</li> <li>Enter the path to the key store file in double quotation marks in the                              <span>KeyStore file</span> field (or click the                              <span>[…]</span> button to the right of the                              <span>KeyStore file</span> field and navigate to the key                           store file).</li> <li>Enter the key store file password in the <span>KeyStore                              password</span> field.</li> <li>Clear the <span>Check server identity</span> option.</li> </ol> |
| OAuth token endpoint | Enter OAuth 2.0 token endpoint.<br><br>This option is available when<br>OAuth 2.0 is selected from the<br>Authentication Type dropdown list. |
| Client ID | Enter the client ID of your application.<br><br>This option is available when<br>OAuth 2.0 is selected from the<br>Authentication Type dropdown list. |
| Client Secret | Enter the client secret of your application.<br><br>This option is available when<br>OAuth 2.0 is selected from the<br>Authentication Type dropdown list. |
| Grant type | Set the grant type for retrieving the access token. Two options are<br>provided: Client Credentials and<br>Password.<br><br>Click [Client Credentials](https://tools.ietf.org/html/rfc6749#section-1.3.4) and [Resource Owner Password Credentials](https://tools.ietf.org/html/rfc6749#section-1.3.3) for related<br>information.<br><br>This option is available when OAuth<br>2.0 is selected from the Authentication<br>Type dropdown list. |
| OAuth username | Enter the OAuth username.<br><br>This option is available when<br>Password is selected from the Grant<br>type dropdown list. |
| OAuth password | Enter the OAuth password.<br><br>To enter the password, click the [...] button<br>next to the password field, enter the password between double quotes in the<br>pop-up dialog box, and then click OK to save the<br>settings.<br><br>This option is available when Password<br>is selected from the Grant type dropdown<br>list.<br><br>Information noteNote: OAuth password does not support spaces. |
| Scope | Enter the scope. See [Scopes](https://docs.snowflake.com/en/user-guide/oauth-ext-overview.html#scopes) for related information.<br><br>This option is<br>available when OAuth 2.0 is selected from the<br>Authentication Type dropdown list. |
| User Id | Enter your login name in double quotation marks. |
| Password | Click the [...] button next to the<br>Password field, enter the password in double quotation<br>marks in the pop-up dialog box, and click OK.<br><br>This field<br>is available if Basic is selected from the<br>Authentication Type dropdown list. |
| Key Alias | Enter the key pair alias in double quotation marks.<br><br>This field is<br>available if Key Pair is selected from the<br>Authentication Type dropdown list. |
| Warehouse | Enter, in double quotation marks, the name of the<br>Snowflake warehouse to be used. This name is case-sensitive and is normally upper<br>case in Snowflake. |
| Schema | Enter,<br>within double quotation marks, the name of the database schema to be used. This name<br>is case-sensitive and is normally upper case in Snowflake. |
| Database | Enter, in double quotation<br>marks, the name of the Snowflake database to be used. This name is case-sensitive<br>and is normally upper case in Snowflake. |
| Use or register a shared DB Connection | Select this checkbox to share<br>your database connection or fetch a database connection shared by a parent or<br>child Job, and in the Shared DB connection name field<br>displayed, enter the name for the shared database connection. This allows you<br>to share one single database connection (except the database schema setting)<br>among several database connection components from different Job levels that can<br>be either parent or child.<br><br>This option is<br>incompatible with the Use dynamic Job and Use an<br>independent process to run subJob options of the<br>tRunJob component. Using a shared connection together with a<br>tRunJob component with either of these two options enabled<br>will cause your Job to fail.<br><br>This checkbox is not available when the Specify a data source<br>alias checkbox is selected. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Auto Commit | Select this option to automatically commit the changes made to the current<br>database when the connection to the database is terminated.<br><br>This option is<br>selected by default.<br><br>Information noteNote: This option has no effect on the tSnowflakeOutput<br>and tSnowflakeRow components. |
| Additional JDBC Parameters | Specify additional JDBC parameters for the<br>database connection created. |
| Login Timeout | Specify the timeout period (in minutes)<br>of Snowflake login attempts. An error will be generated if no response is received<br>in this period. |
| Role | Enter, in<br>double quotation marks, the default access control role to use to initiate the<br>Snowflake session.<br><br>This role must already exist and<br>has been granted to the user ID you are using to connect to Snowflake. If this field<br>is left empty, the PUBLIC role is automatically granted. For information about<br>Snowflake access control model, see [Understanding the Access Control<br>Model](https://docs.snowflake.net/manuals/user-guide/security-access-control.html). |
| URL suffix | Enter, in double quotation marks, the Snowflake custom domain URL of your<br>choice. For more information about Snowflake URL formats, see [Standard account URLs](https://docs.snowflake.com/en/user-guide/organizations-connect#standard-account-urls).<br><br>For Snowflake<br>components other than tSnowflakeConnection, this field is available when you<br>select Use This Component from the Connection<br>Component drop-down list in the Basic<br>settings view. |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each component level. |

## Global variables

| Variables | Description |
| --- | --- |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is more commonly used with other Snowflake components. It<br>creates a Snowflake connection and works with other subJobs that reuse this<br>connection using a Trigger link. |
| Tracing Snowflake JDBC logs | If you wish to merge the Snowflake JDBC driver logs with the logs of the current Job, add this JVM argument, -Dnet.snowflake.jdbc.loggerImpl=net.snowflake.client.log.JDK14Logger, in the Run &gt; Advanced settings tab of the Job you are running. |

**Related concepts**

* [Aggregating Snowflake data using ELT components](https://help.qlik.com/talend/en-US/components/8.0/snowflake/teltinput-teltmap-tsnowflakeinput-tlogrow-aggregating-snowflake-data-using-context-variables-as-table-and-connection-names "This scenario shows you an example of aggregating Snowflake data from two source tables STUDENT and TEACHER to one target table FULLINFO using the ELT components.")
* [Writing data into and reading data from a Snowflake table](https://help.qlik.com/talend/en-US/components/8.0/snowflake/tsnowflakeconnection-tsnowflakerow-tsalesforceconnection-writing-data-into-and-reading-data-from-snowflake-table-standard-component "Here is an example of using Talend Snowflake components to connect to Snowflake, create a Snowflake table, write data into the table, then read data from this table, finally close the connection to Snowflake.")