I am currently creating an ETL job in talend which is connecting to a PostgreSQL database and I ran into a connection error.
I have set up a db connection in my talend repository with all the connection details I need to connect to my postgreSQL database and saved as 'mydbconnection', which specific database schema specified.
I have used mydbconnection
in tPostgreSQLOutput
and tPostgreSQLInput
and both worked perfectly. However, when I use that same connection from the repository in a tEltPostgreSQLOutput_1
it throws an error (see below).
... and have no idea where to go from here. Does anyone know of any other good lines of investigation to resolve this?
Error message:
Exception in component tELTPostgresqlOutput_1
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:137)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:386)
at org.postgresql.Driver.connect(Driver.java:260)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.tELTPostgresqlMap_1Process(is_300_customer_new.java:338)
at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.runJobInTOS(is_300_customer_new.java:602)
at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.main(is_300_customer_new.java:470)
for anyone who runs into this problem in the future.. i found a way around it. I added a tPostgreSQLConnection to my workspace, then ticked the option in my tELTPostgreSQLMap to 'use existing connection' this then seems to remain connected when the work flow reaches the tEltPostgreSQLOutput component. It's not pretty but it works. The more obvious way (the way i had initial done it) does not work. A bug has been added to Talend's JIRA for this exact scenario.