One Star

DB connection error

Hi! I'm trying to use tContextLoad to dynamically change the credentials of the input table but i always end up getting this error...
THANKS! Smiley Happy
7 REPLIES
Moderator

Re: DB connection error

Hi,
Please refer to component reference about tContextLoad with related scenario.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: DB connection error

Hi,
Please refer to component reference about tContextLoad with related scenario.
Best regards
Sabrina

Hi! It's exactly the same reference guide I referred in to. I actually followed each and every step and I had problems connecting to sql server. Pls see the error msg. Thanks!
Community Manager

Re: DB connection error

Hi
From the error message, i am sure there must be something wrong in the DB parameters settings, it seems some value are null or empty. Print the value of context variables on the console to see if the context variables are loaded correctly. For example:
tFileList--iterete--tFileInputDelimited--main--tContextLoad--oncomponentok--tJava--oncomponentok--tmssqlInput---main--tLogRow
on tJava: print the value of context variable,
System.out.println(context.host);
...
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Moderator

Re: DB connection error

Hi,

In addition, here are some articles about Setting up a DB connection
See my pic(the SqlServer DB connection is success in talend open studio for Data Integration 5.3.0)
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: DB connection error

Hi
From the error message, i am sure there must be something wrong in the DB parameters settings, it seems some value are null or empty. Print the value of context variables on the console to see if the context variables are loaded correctly. For example:
tFileList--iterete--tFileInputDelimited--main--tContextLoad--oncomponentok--tJava--oncomponentok--tmssqlInput---main--tLogRow
on tJava: print the value of context variable,
System.out.println(context.host);
...
Shong

Hi Shong! I tried it and all context variables were loaded correctly. Unfortunately, I still get this error in tMSSqlInput:
Exception in component tMSSqlInput_1
java.sql.SQLException: The syntax of the connection URL 'jdbc:jtds:sqlserver://;appName=JM;' is invalid.
at net.sourceforge.jtds.jdbc.Driver.setupConnectProperties(Driver.java:245)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:181)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:221)
at jm.dummy_0_1.dummy.tMSSqlInput_1Process(dummy.java:1706)
at jm.dummy_0_1.dummy.tJava_1Process(dummy.java:1078)
at jm.dummy_0_1.dummy.tFileList_1Process(dummy.java:972)
at jm.dummy_0_1.dummy.runJobInTOS(dummy.java:2758)
at jm.dummy_0_1.dummy.main(dummy.java:2602)
Smiley Sad
Thanks!
Moderator

Re: DB connection error

Hi,
Out of context, did you set your mssql DB connection successfully in a usual DB connection? Is your DB in local or server?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: DB connection error

Hi,
Out of context, did you set your mssql DB connection successfully in a usual DB connection? Is your DB in local or server?
Best regards
Sabrina

Server. Yes I checked in the usual DB connection set up and it was successful. I just don't get it why I'm having errors in tMSSqlLInput. :/