How to set Connector Setting with Variables

1
0
-1

Hello,

I have a problem about setting connector inputs with variables.

For example i have to set MsSql db connector and for example when i set the URL like jdbc:sqlserver://1.2.3.4:1433;databaseName=myDbName and connector start successfully

but extually i am trying with a different way because our connector parameters will be changed and its to easy only change the one of connector set of variable.

i set a variable (data) as olala, the variable of olala is myDbName,

and i try to set the URL like ;

jdbc:sqlserver://1.2.3.4:1433;databaseName=olala -> fails jdbc:sqlserver://1.2.3.4:1433;databaseName=${olala} -> fails jdbc:sqlserver://1.2.3.4:1433;databaseName='${olala}' -> fails

please help me how to set the connector settings with variables?

thanks ,

best Regards.

Comments

Submitted by yannick.lombardi on Wed, 04/22/2015 - 10:01

Hi.

Personnaly, I prefer to use a script in java to set a variable. I use this :

return "jdbc:sqlserver://1.2.3.4:1433;databaseName="+olala;

If you want to set the host and the port, you can use this :

return "jdbc:sqlserver://"+host+":"+port+";databaseName="+olala;
2 answers

1
0
-1
This one is the BEST answer!

Maybe try to set the url as a script expression that returns String, having following content:

'jdbc:sqlserver://1.2.3.4:1433;databaseName=' + olala

1
0
-1

Hello aleksander.bart and yannick.lombardi

thank you so much, i got it ! :)

Regards.

Notifications