Key-pair authentication
- Last Updated: October 29, 2024
- 1 minute read
- DataDirect Connectors
- JDBC
- Snowflake 6.0
- TeamCity 6.0
- Documentation
This string includes the properties used to connect to Snowflake using key-pair authentication.
jdbc:datadirect:snowflake:AccountName=account_name;AuthenticationMethod=KeyPair;
DatabaseName=database_name;Schema=schema_name;Warehouse=warehouse_name;
PrivateKeyFile=privatekeyfile_location;PrivateKeyPassphrase=password;[property=value[;...]];
where:
- account_name
- specifies the full name of your account with region and cloud platform.
- database_name
-
specifies the name of the database to which you are connecting.
- schema_name
-
specifies the default schema to use for the specified database once connected. The specified schema should be an existing schema for which the specified default role has privileges.
- warehouse_name
-
specifies the virtual warehouse to use once connected. The specified warehouse should be an existing warehouse for which the specified default role has privileges.
- privatekeyfile_location
- specifies the absolute path to the private key file you want to use for authentication.
Note: Alternatively, you can specify the content of a private key in the
connection string. To specify the private key content, use the PrivateKeyContent connection
property.
- password
- specifies a password that is used to descrypt either a private key or the content of a private key.
- property=value
- specifies connection property settings. Multiple properties are separated by a semi-colon.
The following example connection string includes the properties required for connecting with key-pair authentication.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:snowflake:AccountName=account_name.us-east-1;
AuthenticationMethod=KeyPair;DatabaseName=payroll;Schema=xyz;Warehouse=accounting;
PrivateKeyFile=C:\Program Files\privatekey.p8;PrivateKeyPassphrase=abc123;");