July 31, 2023

tJDBCConnection – Docs for ESB Jdbc 7.x

tJDBCConnection

Opens a connection to the specified database that can then be reused in the
subsequent subjob or subjobs.

tJDBCConnection Standard properties

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

The Standard
tJDBCConnection component belongs to the Databases and the ELT families.

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

Note: 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 Dynamic database components.

Basic settings

Database

Select a type of database from the list and click
Apply.

Property Type

Select the way the connection details
will be set.

  • Built-In: The connection details will be set
    locally for this component. You need to specify the values for all
    related connection properties manually.

  • Repository: The connection details stored
    centrally in Repository > Metadata will be reused by this component. You need to click
    the […] button next to it and in the pop-up
    Repository Content dialog box, select the
    connection details to be reused, and all related connection
    properties will be automatically filled in.

JDBC URL

The JDBC URL of the database to be used. For
example, the JDBC URL for the Amazon Redshift database is jdbc:redshift://endpoint:port/database.

Drivers

Complete this table to load the driver JARs needed. To do
this, click the [+] button under the table to add
as many rows as needed, each row for a driver JAR, then select the cell and click the
[…] button at the right side of the cell to
open the Module dialog box from which you can select the driver JAR
to be used. For example, the driver jar RedshiftJDBC41-1.1.13.1013.jar for the Redshift database.

For more information, see Importing a database driver.

Driver Class

Enter the class name for the specified driver between double
quotation marks. For example, for the RedshiftJDBC41-1.1.13.1013.jar driver, the name to be entered is
com.amazon.redshift.jdbc41.Driver.

Use Id and Password

The database user authentication data.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

Use or register a shared DB Connection

Select this check box to share your
database connection or fetch a database connection shared by a parent or child Job,
and in the Shared DB Connection Name field displayed, enter the
name for the shared database connection. This allows you to share one single database
connection (except the database schema setting) among several database connection
components from different Job levels that can be either parent or child.

This option is
incompatible with the Use dynamic job and Use an
independent process to run subjob
options of the
tRunJob component. Using a shared connection together with a
tRunJob component with either of these two options enabled
will cause your Job to fail.

This check box is not available when the Specify a data source
alias
check box is selected.

Specify a data source alias

Select this check box and in the
Data source alias field displayed, specify the alias of
a data source created on Talend Runtime side to use
the shared connection pool defined in the data source configuration. This option
works only when you deploy and run your Job in Talend Runtime.

This check box is not available when the Use or register a shared DB
Connection
check box is selected.

Advanced settings

Use Auto-Commit

Select this check box to activate the auto commit mode.

Auto Commit

Select this check box to commit any changes to the database
automatically upon the transaction.

With this check box selected, you cannot use the corresponding
commit component to commit changes to the database; likewise, when using the
corresponding commit component, this check box has to be cleared. By
default, the auto commit function is disabled and changes must be committed
explicitly using the corresponding commit component.

Note that the auto commit function commits each SQL statement as a
single transaction immediately after the statement is executed while the
commit component does not commit only until all of the statements are
executed. For this reason, if you need more room to manage your transactions
in a Job, it is recommended to use the commit component.

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at the Job level
as well as at each component level.

Global Variables

ERROR_MESSAGE

The error message generated by the component when an error occurs. This is an After
variable and it returns a string.

Usage

Usage rule

This component is more commonly used with other tJDBC*
components, especially with the tJDBCCommit and tJDBCRollback components.

Importing a database driver

To enable a JDBC component work with a specific database, you need to import the
corresponding data driver into the component.

  1. If the library to be imported isn’t available on your machine, either download
    and install it using the Modules view or download and
    store it in a local directory.
  2. In the Drivers table, add one row to the table by
    clicking the [+] button.

    tJDBCConnection_1.png

  3. Click the newly added row and click the […] button to
    open the Module dialog box where you can import the
    external library.

    tJDBCConnection_2.png

  4. If you have installed the library using the Modules
    view:

    • Select the Platform option and then select the
      library from the list.
    • Select the Artifact repository (local m2/nexus) > Find by name or Artifact repository (local m2/nexus) > Find by Maven URI option, then specify the full name or Maven URI of the
      library module, and click the Detect the module install
      status
      button to validate its installation status.
  5. If you have stored the library file in a local directory:

    1. Select the Artifact repository (local m2/nexus)
      option.
    2. Select the Install a new module option, and
      click the […] button to browse to library
      file.
    3. If you need to customize the Maven URI of the library, select the
      Custom MVN URI check box, specify the new
      URI, and then click the Detect the module install
      status
      button to validate its installation status.

      Note:

      Changing the Maven URI for an external module will affect all the
      components and metadata connections that use that module within
      the project.

      When working on a remote project, your
      custom Maven URI settings will be automatically synchronized to
      the Talend Artifact Repository and will be used
      when other users working on the same project install the
      external module.

  6. Click OK to confirm your changes.

    The imported library file is listed in the Drivers
    table.
    Note: You can replace or delete the imported library, or import new libraries
    if needed.

Related scenario

For tJDBCConnection related scenario, see tMysqlConnection


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x