Connecting KNIME To Snowflake With a Proxy Server

It has taken me severl days to get this debugged. So I wanted to share this in the forum for anyone else who encounters this situation. If you are using a SNOWFLAKE data warehouse and your company also requires the use of a proxy server, you need to make some special adjustments to your connection string and the KNIME.INI file as well.

The first thing you need to change is your KNIME.INI file. This is not documented in the SNOWFLAKE JDBC driver usage (Snowflake JDBC Configuration). But add these lines to force KNIME to use the proxy server:

-Dhttp.useProxy=true
-Dhttps.useProxy=true
-Dhttps.proxyHost=<proxy_host>
-Dhttp.proxyHost=<proxy_host>
-Dhttps.proxyPort=<proxy_port>
-Dhttp.proxyPort=<proxy_port>

Be sure to include both HTTP and HTTPS parameter sets. The documentation says you do not need to pass these as JVM arguments and can instead use them as parameters in your connection string however with KNIME that does not work. Restart KNIME for these changes to take effect. When it restarts you may be prompted for a userid and password but it won’t identify what the credentials are for. If your proxy server needs login information this is how it will prompt you. After you enter it KNIME does not ask again so I assume its storing those credentials somewhere (I hope encrypted). It is possible to specify the credentials in the KNIME.INI file as well however I would not recommend that since it would be stored in open text on your computer. But you could add these four lines:

-Dhttp.proxyUser=<userid>
-Dhttps.proxyUser=<userid>
-Dhttp.proxyPassword=<password>
-Dhttps.proxyPassword=<password>

Now on your database URL connection string you need to repeat this same information. Your new connection string should look like this:

jdbc:snowflake://accountname.regionid.snowflakecomputing.com/?warehouse=warehouse&database=database&CLIENT_SESSION_KEEP_ALIVE=true&useProxy=true&proxyHost=host&proxyPort=port

You should include the CLIENT_SESSION_KEEP_ALIVE=true parameter or your snowflake connection will be shutdown after 4 hours of inactivity.

You may need to add login credentials for the proxy server. If so add these two parameters to the database URL:

 &proxyUser=<user>&proxyPassword=<password>
1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.