# cSQLConnection

Opens a connection to the specified database that can then be reused in the subsequent subRoute.

Information noteNote: This component is available only if you have installed the R2022-11 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.

## cSQLConnection Standard properties

These properties are used to configure cSQLConnection running in the Standard Route framework.

The Standard cSQLConnection component belongs to the Connectivity family.

## Basic settings

| Properties | Description |
| --- | --- |
| Database | 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><br><br>You can drag and drop a JDBC connection from the<br>Metadata node of the<br>Repository tree view to the design workspace to<br>create a cSQLConnection component.<br><br>Information noteNote: This option is available only if you have installed the R2023-05 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| Driver Class | Enter the class name for the specified driver between double<br>quotation marks. |
| Driver JAR | Complete this table to load the driver JARs needed. To do this, click<br>the [+] button under the table to add as many rows as<br>needed, each row for a driver JAR, then select the cell and click the<br>[...] button at the right side of the cell to open<br>the Module dialog box from which you can select the driver<br>JAR to be used.<br><br>For more information, see [Importing a database driver](https://help.qlik.com/talend/r/en-US/8.0/jdbc/importing-database-driver). |
| JDBC URL | The JDBC URL of the database to be used. |
| Authentication | Select this check box to enter the database user authentication data. The<br>User Id and Password fields<br>appear when this check box is selected.<br><br>To enter the password, click the [...] button next to the password field, enter the password in<br>double quotes in the pop-up dialog box, and click OK to save the settings. |
| Specify a data source alias | Select this check box and in the<br>Data source alias field displayed, specify the alias<br>of a data source created on the Talend Runtime side to use the shared connection pool defined in the data source<br>configuration. This option works only when you deploy and run your Route in<br>Talend Runtime. |
| Use Transaction | Select this check box to enable local transaction for the<br>connection. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Initial Connections | Specify the maximum number of initial connections. |
| Max Connections | Specify the maximum number of connections. |
| Min Idle Connections | Specify the minimum number of idle connections (connections not used). |
| Max Idle Connections | Specify the maximum number of idle connections (connections not<br>used). |
| Set Timeouts | Select this check box to set the timeout options.<br><br><ul> <li> <span>Query Timeout (sec)</span>: Set a timeout period for the                        query in seconds. A value of <span>-1</span> means that no timeout is                        set.</li> <li> <span>Max Connection duration (sec)</span>: Set a maximum                        duration of the connection in seconds.   A value of <span>-1</span>                        means that no timeout is set.</li> </ul> |
| Use validation query | Select this check box to validate the database connection using a query.<br><br><ul> <li> <span>Validation Query Timeout (sec)</span>: Set a timeout period                        for the validation query in seconds. A value of <span>-1</span> means                        that no timeout is set.</li> <li> <span>Validation query</span>: Enter an SQL SELECT statement to                        validate the connection.</li> </ul> |
| Use SQL Initialization | Select this check box to initialize the database server by entering a query<br>in the Init Query box. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | cSQLConnection can be added directly in a<br>Route without any input or output component linked. |
| Limitation | n/a |

**Related concepts**

* [Writing and reading data in an H2 database with an SQL statement](https://help.qlik.com/talend/en-US/mediation-components/8.0/mediation-database/csql-writing-and-reading-data-in-an-h2-database-with-an-sql-statement)