tJDBCInput
Reads any database using a JDBC API connection and extracts fields based on a
query.
tJDBCInput executes a database query
with a strictly defined order which must correspond to the schema definition. Then it
passes on the field list to the next component via a Main row link.
Depending on the Talend
product you are using, this component can be used in one, some or all of the following
Job frameworks:
-
Standard: see tJDBCInput Standard properties.
The component in this framework is available in all Talend
products. -
MapReduce: see tJDBCInput MapReduce properties (deprecated).
The component in this framework is available in all subscription-based Talend products with Big Data
and Talend Data Fabric. -
Spark Batch: see tJDBCInput properties for Apache Spark Batch.
This component also allows you to connect and read data from a
RDS MariaDB, a RDS PostgreSQL or a RDS SQLServer database.The component in this framework is available in all subscription-based Talend products with Big Data
and Talend Data Fabric.
tJDBCInput Standard properties
These properties are used to configure tJDBCInput running in
the Standard Job framework.
The Standard
tJDBCInput component belongs to the Databases family.
The component in this framework is available in all Talend
products.
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 |
Property Type |
Select the way the connection details
This property is not available when other connection component is selected |
|
Click this icon to open a database connection wizard and store the For more information about setting up and storing database |
Connection Component |
Select the component that opens the database connection to be reused by this |
JDBC URL |
The JDBC URL of the database to be used. For |
Drivers |
Complete this table to load the driver JARs needed. To do For more information, see Importing a database driver. |
Driver Class |
Enter the class name for the specified driver between double |
Use Id and Password |
The database user authentication data. To enter the password, click the […] button next to the |
Schema and Edit schema |
A schema is a row description. It defines the number of fields
Click Edit
schema to make changes to the schema. Note: If you
make changes, the schema automatically becomes built-in.
This This |
Table Name |
The name of the table from which data will be retrieved. |
Query Type and Query |
Specify the database query statement paying particularly attention to the
If using the dynamic schema feature, the SELECT query must |
Guess Query |
Click this button to generate query in the Query field based on |
Guess Schema |
Click this button to generate schema columns based on the query defined in the |
Specify a data source alias |
Select this check box and in the This property is not available when other connection component is selected from |
Advanced settings
Use cursor |
Select this check box to specify the number of rows you want to work with at |
Trim all the String/Char columns |
Select this check box to remove leading whitespace and trailing |
Check column to trim |
Select the check box for corresponding column to remove leading whitespace This property is not available when the Trim all the String/Char |
Enable Mapping File for |
Select this check box to use the specified metadata With this check box selected, you can specify the metadata mapping file For more information about metadata mapping files, see |
Use PreparedStatement |
Select this check box if you want to query the database using a prepared statement. In
For a related use case of this property, see Using PreparedStatement objects to query data. |
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the Job level |
Global Variables
ERROR_MESSAGE |
The error message generated by the component when an error occurs. This is an After |
NB_LINE |
The number of rows processed. This is an After variable and it returns an integer. |
QUERY |
The query statement being processed. This is a Flow variable and it returns a |
Usage
Usage rule |
This component covers all possible SQL queries for any |
Dynamic settings |
Click the [+] button to add a row in the table For examples on using dynamic parameters, see Reading data from databases through context-based dynamic connections and Reading data from different MySQL databases using dynamically loaded connection parameters. For more information on Dynamic |
Related scenarios
For related topics, see:
Related topic in tContextLoad: see Reading data from different MySQL databases using dynamically loaded connection parameters.
tJDBCInput MapReduce properties (deprecated)
These properties are used to configure tJDBCInput running in the MapReduce Job
framework.
The MapReduce
tJDBCInput component belongs to the MapReduce family.
The component in this framework is available in all subscription-based Talend products with Big Data
and Talend Data Fabric.
The MapReduce framework is deprecated from Talend 7.3 onwards. Use Talend Jobs for Apache Spark to accomplish your integration tasks.
Basic settings
Property type |
Either Built-In or Repository. |
|
Built-In: No property data stored centrally. |
|
Repository: Select the repository file where the |
![]() |
Click this icon to open a database connection wizard and store the For more information about setting up and storing database |
JDBC URL |
The JDBC URL of the database to be used. For |
Driver JAR |
Complete this table to load the driver JARs needed. To do For more information, see Importing a database driver. |
Class Name |
Enter the class name for the specified driver between double |
Username and Password |
The JDBC URL of the database to be used. For To enter the password, click the […] button next to the |
Schema and Edit schema |
A schema is a row description. It defines the number of fields |
|
Built-In: You create and store the schema locally for this component |
|
Repository: You have already created the schema and stored it in the |
Click Edit
|
|
Table Name |
Type in the name of the table from which you need to read |
Die on error |
Select the check box to stop the execution of the Job when an error Clear the check box to skip any rows on error and complete the process for |
Query type and |
Specify the database query statement paying particularly attention to the If using the dynamic schema feature, the SELECT query must |
Usage
Usage rule |
In a For further information about a Note that in this documentation, unless otherwise |
Hadoop Connection |
You need to use the Hadoop Configuration tab in the This connection is effective on a per-Job basis. |
Limitation |
We recommend using the following databases It may work with other databases as well, but |
Related scenarios
No scenario is available for the Map/Reduce version of this component yet.
tJDBCInput properties for Apache Spark Batch
These properties are used to configure tJDBCInput running in the Spark Batch Job
framework.
The Spark Batch
tJDBCInput component belongs to the Databases family.
This component also allows you to connect and read data from a
RDS MariaDB, a RDS PostgreSQL or a RDS SQLServer database.
The component in this framework is available in all subscription-based Talend products with Big Data
and Talend Data Fabric.
Basic settings
Property type |
Either Built-In or Repository. |
||
|
Built-In: No property data stored centrally. |
||
|
Repository: Select the repository file where the |
||
Use an existing |
Select this check box and in the Component List click the relevant connection component to |
||
JDBC URL |
The JDBC URL of the database to be used. For If you are using Spark V1.3, this URL should contain the
authentication information, such as:
|
||
Driver JAR |
Complete this table to load the driver JARs needed. To do For more information, see Importing a database driver. |
||
Class Name |
Enter the class name for the specified driver between double |
||
Username and Password |
Enter the authentication information to the database you need To enter the password, click the […] button next to the Available only for Spark V1.4. and onwards. |
||
Schema and Edit schema |
A schema is a row description. It defines the number of fields |
||
|
Built-In: You create and store the schema locally for this component |
||
|
Repository: You have already created the schema and stored it in the |
||
Click Edit
|
|||
Table Name |
Type in the name of the table from which you need to read |
||
Query type and |
Specify the database query statement paying particularly attention to the If you are using Spark V2.0 onwards, the Spark SQL does not For example, if you need to perform a query in a table system.mytable, in which the system prefix indicates the schema that the mytable table belongs to, in the query, you must enter mytable only. |
||
Guess Query |
Click the Guess Query button to generate the query which |
||
Guess schema |
Click the Guess schema button to retrieve the table |
Advanced settings
Additional JDBC |
Specify additional connection properties for the database connection you are This field is not available if the Use an existing |
Spark SQL JDBC |
Add the JDBC properties supported by Spark SQL to this table. This component automatically set the url, dbtable and driver properties by using the configuration from |
Trim all the String/Char |
Select this check box to remove leading whitespace and trailing |
Trim column |
This table is filled automatically with the schema being used. Select the check |
Enable partitioning |
Select this check box to read data in partitions. Define, within double quotation marks, the following parameters to
configure the partitioning:
The average size of the partitions is the result of the difference between the For example, to partition 1000 rows into 4 partitions, if you enter 0 for |
Usage
Usage rule |
This component is used as a start component and requires an output This component should use a tJDBCConfiguration component present in the same Job to This component, along with the Spark Batch component Palette it belongs to, Note that in this documentation, unless otherwise explicitly stated, a |
Spark Connection |
In the Spark
Configuration tab in the Run view, define the connection to a given Spark cluster for the whole Job. In addition, since the Job expects its dependent jar files for execution, you must specify the directory in the file system to which these jar files are transferred so that Spark can access these files:
This connection is effective on a per-Job basis. |
Related scenarios
For a scenario about how to use the same type of component in a Spark Batch Job, see Writing and reading data from MongoDB using a Spark Batch Job.