After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL. The following example includes the properties required for connecting with UserID/Password authentication.

Connection URL Syntax

The connection URL takes the following form:

jdbc:datadirect:snowflake://snowflakecomputing.com;AccountName=account_name;
UserName=user_name;Password=password;[property=value[;...]];

where:

server_name
specifies the base URL of the Snowflake instance to which you want to issue requests. For example, //snowflakecomputing.com.
account_name
specifies the the full name of your account with region and cloud platform.
user_name
Specifies the user ID used to authenticate to Snowflake with UserID/Password authentication method.
password
Specifies the password used to authenticate to Snowflake with UserID/Password authentication method.

Important: The password is a confidential value used to authenticate to the server. To prevent unauthorized access, this value must be securely maintained.

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 the UserID/Password authentication.

Connection conn = DriverManager.getConnection
("jdbc:datadirect:snowflake://snowflakecomputing.com;AccountName=accountname.us-east-1;
  UserName=JohnSmith;Password=abc123");