Immanuel Raj
Tera Contributor
Prerequisites:

1. MIDSERVER

2. SNOWFLAKE CREDENTIALS WITH BASIC AUTHENTICATION

Below are the steps to integrate with Snowflake.

Step1: Download the latest JAR file from maven repository with extension JAR and download the highlighted file.

Link:https://repo1.maven.org/maven2/net/snowflake/snowflake-jdbc/

Link to Download the file : https://repo1.maven.org/maven2/net/snowflake/snowflake-jdbc/3.13.6/

 

find_real_file.png

 

Step2: Attach the Downloaded files to ServiceNow below are the steps mentioned.

Navigate -> Mid server ->JAR Files 

Attach the downloaded file and fill out the respective field values.

find_real_file.png 

And then "Submit" the form. Incase you are getting the below error ignore it.

find_real_file.png

This file will be uploaded to MIDSERVER in the Agent -> lib -> extlib folder.

Note: When uploading the JAR file from ServiceNow Instance it will be uploaded to all the "Mid Server" running on the ServiceNow Instance and automatically all the midserver will be restarted once the JAR file is uploaded. Make sure to do this exercise in non business hours for production Instance.

Step3:

Configuring the DATA SOURCE

Navigate -> System Import sets -> Data Sources 

Create a New Data Source

Select the Type as "JDBC"  find_real_file.pngand create a new "Format" as "Snowflake" on the Data source form.

 

find_real_file.png

Label: Snowflake 

Value : net.snowflake.client.jdbc.SnowflakeDriver

This can also be referenced in this website : https://docs.snowflake.com/en/user-guide/jdbc-configure.html#other-parameters

 

Sample Datasource Form:

find_real_file.png

 

MIDSERVER: Use any of your MID Server (Because the JAR will be Loaded onto all MIDSERVERS on your Instance)

DATABASENAME : SNOWFLAKE DATABASE NAME from which you're retrieving the data.

USERNAME: SNOWFLAKE USERNAME

PASSWORD: SNOWFLAKE PASSWORD

 

Step:4 

Setting up Connection URL to communicate with SNOWFLAKE

Create a "Before Insert BR" on the Data source table to dynamically construct the Connection URL with conditions.

find_real_file.png

Script:

find_real_file.png

SAMPLE CONNECTION URL:

current.connection_url = "jdbc:snowflake://YOUR ACCOUNT NAME.YOUR REGION.snowflakecomputing.com/?user=" + current.jdbc_user_name + "&password=" + current.jdbc_password + "&warehouse=YOUR WAREHOUSE NAME &db=" + current.database_name + "&schema= YOUR SCHEMA NAME FROM SNOWFLAKE &role= YOUR SNOWFLAKE ROLE NAME";

 

YOUR ACCOUNT NAME : SNOWFLAKE ACCOUNT NAME

YOUR REGION : This differs based on the region (E.g for US starts with (us.east..) for EUROPE -> (eu.central )

USER: It will be retrieved from Datasource "Username" field.

PASSWORD: It will be retrieved from Datasource "Password" field.

WAREHOUSE : YOUR SNOWFLAKE WAREHOUSE NAME

DATABASE (db) : It will be retrieved from Datasource "Database" field.

SCHEMA : YOUR SCHEMA NAME FROM SNOWFLAKE

ROLE: YOUR SNOWFLAKE ROLE NAME

 

NOTE: Ask SNOWFLAKE team to create a local account with Basic Authentication method for the Servicenow user inorder to communicate with SNOWFLAKE.

After setting all this you should be able to Test load 20 records from SNOWFLAKE.

 

Referal Liks and Docs:

https://docs.snowflake.com/en/user-guide/jdbc-configure.html#other-parameters

https://docs.snowflake.com/en/user-guide/admin-account-identifier.html

https://docs.snowflake.com/en/user-guide/jdbc-configure.html#jdbc-driver-class

https://docs.snowflake.com/en/user-guide/jdbc-configure.html#jdbc-driver-connection-string

Comments
raja31
Tera Contributor

Hi immanuel,

 

We have attached jar file, but in mid server we can see a folder name agent. but we can't see lib.

so if we can't able to see lib then it considered as file is not installed?

Any idea on that

Immanuel Raj
Tera Contributor

Hi Raja,

 

There should be folder name extlib check in it.

 

Please go through the below link to troubleshoot for any errors occurred on your MID Server.

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0535148

ZackNicholson
Mega Explorer

I set this up but I am getting this error when trying to load 20 test records

 

MID Server reported error: java.sql.SQLException: com.snc.automation_common.integration.exceptions.InvalidConnectionParameterException: JDBC connection string not specified

 

any help would be great! Followed all the steps exactly here.

 

**EDIT**

I fixed that error by setting the connection string in the list view of the data sources table, now I'm getting this error

InvalidConnectionParameterException: Unable to load JDBC driver

 

**EDIT**

my Format field Snowflake had the wrong value need to have net.snowflake.client.jdbc.SnowflakeDriver

Renee Yu1
Tera Contributor

I followed the steps to set up the snowflake integration.  But I got below error while trying to test load 20 records.

MID Server reported error: SQLState: null
java.sql.SQLException: net.snowflake.client.jdbc.SnowflakeSQLException: Connection string is invalid. Unable to parse.

Has anybody encountered this error?  I followed the steps exactly. 

 

Thanks,

Renee

Renee Yu1
Tera Contributor

I figured it out.  It appears that there were spaces in the sample BR above, especially right before "&role".  I removed the spaces and the error went away.

Jason Burns3
Tera Contributor

Has anyone used the Snowflake Connector? Snowflake Connector for ServiceNow Installation

Renee Yu1
Tera Contributor

Hi Jason:

 

I think Snowflake connector that you mentioned is to bring ServiceNow data into Snowflake.  The discussion here is to bring Snowflake data into ServiceNow.  We are trying to integrate Snowflake into ServiceNow, not the other way around.  With that being said, the steps mentioned above by Immanuel does work.  The only drawback is that it's using local user account, which is not the most secure way to authenticate.  We are still looking into other options for more secure authentication.  Hopefully that helps.

VinothKumar Mur
Tera Contributor

I have installed the JAR file for the mid server and able to find it in the mid server host under ext-lib, however I am still getting error as below

 

MID Server reported error: SQLState: null
java.sql.SQLException: java.sql.SQLException: No suitable driver found for jdbc:snowflake

srinivass315171
Tera Contributor

Hi @VinothKumar Mur ,

 

Did the issue got resolved? I'm getting the same error 

MID Server reported error: SQLState: null
java.sql.SQLException: java.sql.SQLException: No suitable driver found

 

Regards,

Srinivas

srinivass315171
Tera Contributor

Hi @VinothKumar Mur 

 

Did the issue is resolved, I'm getting the similar error

MID Server reported error: SQLState: null
java.sql.SQLException: java.sql.SQLException: No suitable driver found

 

Regards

Srinivas

srinivass315171
Tera Contributor

Hi @VinothKumar Mur 

 

Did the issue got resolved, I'm getting the same error

MID Server reported error: SQLState: null
java.sql.SQLException: java.sql.SQLException: No suitable driver found for jdbc:snowflake

 

Thanks 

Srinivas

VinothKumar Mur
Tera Contributor

@srinivass315171 ,

 

No, I am still unable to found any solution

SupriyaWaghmode
Kilo Sage

Hello Team 

I am looking for key pair authentication, user- password basic authentication is exist but , customer asking for key-pair authentication 

divyalakshmi
Tera Guru

@SupriyaWaghmode @Immanuel Raj  Does  key pair authentication is possible in this integration?

SupriyaWaghmode
Kilo Sage

Hello Divya ,

 

Key-pair method for connecting with Snowflake can be found in the Snowflake documentation. It is advisable to attempt a proof of concept initially. In my situation, we encountered issues implementing the key-pair method while connecting with Snowflake from ServiceNow. Despite ServiceNow's team sharing only a link to the documentation, the detailed steps were not provided.

 

As an alternative approach, we have chosen to utilize Snowflake Spoke within Snow.

 

 

Version history
Last update:
‎09-27-2021 04:46 AM
Updated by: