Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
peterko
Contributor III
Contributor III

[resolved] Run Builded Job in Server - JDBC error

Hi, I created a Job that connects to a PostgreSQL database.  I exported job as standalone job. After running on Ubuntu 14.04 LTS Server reports an error:
Exception in component connectionStatsLogs 
java.sql.SQLException: No Suitable driver found for jdbc: postgresql: // null: null / null 

Where should I store the JDBC driver? Into the project? 
Thank you for your help
Labels (4)
9 Replies
Anonymous
Not applicable

Hi,
Based on error, the variable values for postgres driver are not passed to component. Please check your job settings and variable usage... If it is inside subjob and you are passing variable from parent then in standalone job mode, the context variable would not be available from parent. Please explain your job design and structure.
Thanks
vaibhav
peterko
Contributor III
Contributor III
Author

Hey. 
Structure my work is that I have a main job. it starts several separate subjobs. We use the context for the connection to the DB. 
Buil Job is as follows:
0683p000009MEgD.png
Anonymous
Not applicable

Hi,
Have you tried to check out "Context scripts" to export ALL context parameters files?
TalendHelpCenter:How to build Jobs
Best regards
Sabrina
peterko
Contributor III
Contributor III
Author

I have not tried it. I understood, that if I later want to change the value of Context, so I had to change the values in each of the script. But I want to change the values only in one place. That's why I did not tick value "Context scripts".
So this is the reason why I report bugs?
Anonymous
Not applicable

Hi,
Another approach is to use tContextLoad in parent job from one property file or fixedflow component and enable "Transmit whole context" to child jobs option on subjobs.
Thanks
Vaibhav
Anonymous
Not applicable

Anonymous
Not applicable

sanvaibhav +1
I think it's the only right way ... load context from file or DB with tContextLoad or implicit context load (I use to load with implicit option).
Talend writes files with context by his own when you build job ...but don't use them 0683p000009MACn.png
Use a dedicated file like a Config.ini. 
regards
laurent
peterko
Contributor III
Contributor III
Author

Thanks.
It helped check "Context scripts". But now the problem is with the fact, that Talend is created for each Job separate context (I have about 30), so editing is challenging. 
So will help when I load the context from an external file, then I can edit only one context file?
But how to determine context for the external context file? I mean the path to the file. It is possible to determine path in sh script?
Thanks
Anonymous
Not applicable

a very simple job : write a message due to different environment 0683p000009MACn.png
by default my message (context.message is null). I want to populate the context variable only with a config.ini 
So create a file config.ini anywhere and load context via tContextLoad or implicit Context load.(use impplicit for ex)
in my config.ini I initialize my variable 'message'
message=value in dev

launch your job to see if everthing is OK 0683p000009MA9p.png
you have something like  :
Démarrage du job talendJob a 12:44 22/08/2014.
connecting to socket on port 3742
connected
Implicit_Context_Context set key "message" with value "value in dev"
value in dev
disconnected
Job talendJob terminé à 12:44 22/08/2014.


But config's path is hard-coding ... create a new context variable for it (context.configPath)!
Build job and modify script by adding 
--context_param configPath=C:/Users/lraulier/Documents/config.ini



0683p000009MEn8.png 0683p000009MEkj.png 0683p000009MEl3.png 0683p000009MElr.png
now run job with script ! 
You can tell any other path to another config.ini (int, prod, test ..) and modify value of the message without build job again.
hope it help
regard
laurent