Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tJava - No suitable driver found for jdbc:postgresql

Hello,
I have a job containing of one component which is a tJava component. In this component I want to do a select on a database then connect to LDAP to get some data and write the gotten data back to the database.
I wrote my code in Eclipse where it is working. When now copying it into the tJava component and trying to run it there, I get the following error:
Exception in component tJava_1
java.sql.SQLException: No suitable driver found for jdbc 0683p000009MAB6.pngostgresql://localhost/PortalDW
What am I doing wrong or what did I forget to do?
Kind regards
Nadja
Labels (4)
7 Replies
janhess
Creator II

Don't use tJava. Use tdatabasetypeInput and tLDAPInput.
Anonymous
Not applicable
Author

I cannot do this, because for the LDAP part I need to use StartTLS and this option is not available in tLDAPInput. But thanks for the suggestion.
Any other ideas?
janhess
Creator II

But could you still use the tPostgresInput ?
Anonymous
Not applicable
Author

Well I think not, because I need to be able to iterate over the result of the SQL query in tJava because the LDAP query is dependent on the SQL query. And as I found out, tJava has no input. Oh do you have an idea?
Anonymous
Not applicable
Author

Hi Nadja, Why do you expect the PostgreSQL driver is loaded only by calling an JDBC call?
The components for the databases organizes the driver load, your code does not do this.
You have to load the JDBC driver with tLoadLibrary component (before your own code comes in action).
Anonymous
Not applicable
Author

Hi jlolling,
thanks for your reply. I was not aware of the fact that I need to load the library first. That was why I asked. I'm not that familiar with Talend yet and still need some practice. But thanks for the help, this solution works fine for me and solved my issue.
Kind regards
Nadja
Anonymous
Not applicable
Author

Well I think not, because I need to be able to iterate over the result of the SQL query in tJava because the LDAP query is dependent on the SQL query. And as I found out, tJava has no input. Oh do you have an idea?

You can use tPostgresqlInput for your database part to select record from postgresql database, and use tJavaFlex, instead of tJava, which allows you to access the input data flow and has output data flow. Take a look at this KB article The difference between tJava, tJavaRow and tJavaFlex.
Shong