How to set Connector Setting with Variables

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.

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

Hello aleksander.bart and yannick.lombardi

thank you so much, i got it ! :slight_smile:

Regards.

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;