How can I connect to a Snowflake database via JDBC using the "database" command in MATLAB R2022b?

54 views (last 30 days)
I am attempting to connect to a Snowflake database via JDBC using the "database" command. I am unclear on the correct syntax for the arguments to this command, as Snowflake is specific regarding parameters and URL formatting. 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Apr 2023
Edited: MathWorks Support Team on 19 Apr 2023
Refer to the following for an example MATLAB command to connect to a Snowflake database via JDBC using the "database" function: 
>> conn = database('','<username>','<password>’,'net.snowflake.client.jdbc.SnowflakeDriver','jdbc:snowflake://<account_identifier>.snowflakecomputing.com/?db=<dbname>;') 
Note the following:
  • The database name is passed in as a parameter in the URL, rather than in the first argument or a name-value pair argument.
  • Parameters are included in the URL, rather than in name-value pair arguments.
  • The account identifier is the same as described in the Snowflake documentation: 
  • If you have additional access restrictions such as a region or PrivateLink, they can be included with the account identifier. For example, "myorg.myregion.privatelink.snowflakecomputing.com".

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!