Quick and Dirty learning — Creating MuleSoft SnowflakeDB Connector

Very frequently I resort to quick and dirty learning short-cuts. One reason I avoid, whenever possible, reinventing the wheel and second, more importantly, these short-cuts provide me with a starting point for diving deep.Here is a flow to create a Snowflake DB connector in Anypoint Studio which I thought may be helpful for some others like me.

This contains a lot of screenshots — for visual clarity. Let’s run through the steps -

  1. Create a project.

2. Add a listener and logger.

3. Add a database Select component.

4) Now we create a “Generic” database configuration.

5) And this is what we have to setup -

6) Time to switch over to your Snowflake account and get the JDBC library as well as some important instructions. Go to Help->Download->JDBC Driver

7) Click Maven Repository and chose the latest version available (for now i.e. 25th Jan 2021 it is 3.12.17)

8) Download the jar file (you can guess from the size — it is the largest available in that folder).

9) From the given page — take 2 important piece of information.

10) First item is the driver class (highlighted in screenshot) and the driver connection string (highlighted as well).

11) Let’s go back to the Anypoint studio and the database configuration that we were doing-

12) Go to JDBC Driver -> Use Local File

13) It takes you to following screen -

14) Browse for the jar file you just downloaded.

15) Once you select OK the file will be installed in Maven repository for your project-

16) Fill in the Driver class name, URL, User and Password as given below and run — Test Connection

The driver class name and URL comes from the step 10.

Driver class name — net.snowflake.client.jdbc.SnowflakeDriver

URL — jdbc:snowflake://<hostname url of your snowflake account>/?user=<your_user_name>

User — Your Snowflake account username

Password — Your Snowflake account password

Voila you are done!

You can add more items (e.g. schema, database, warehouse etc.) in the URL. You can also encrypt the values as well. But all those are for a different quick and dirty write up.

--

--

Virendra Pratap Singh

Snowflake, AWS, Python, MuleSoft and literally anything to do with data manipulation and analysis!! Love simple solutions and willing to learn from anyone.