BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jcamp
Calcite | Level 5

I am working on the SAS Grid AIX system using SAS Enterprise Guide. I'm trying to connect to a Snowflake sandbox environment as a POC to prove that AIX's JDBC connector will connect to Snowflake.  On top of that, I'm required to use key pairs (SSH RSA keys) to authenticate. I'm having trouble with the syntax.

 

I tested the key pairs using Snowsql. I was able to connect, so I know that the keys are working.

 

Here is what I tried:

 

proc sql;
connect to jdbc as C (driverclass="net.snowflake.client.jdbc.SnowflakeDriver"
URL="jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com" authenticator=SNOWFLAKE_JWT private_key_file=/home/user/rsa_key.p8 private_key_file_pwd=mypwd classpath="/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar");
select * from connection to C (select count(*) from DB_NAME.SCHEMA_NAME.TABLE_NAME);
quit;

ERROR: Invalid option name authenticator.
ERROR: The C engine cannot be found.
ERROR: A Connection to the C DBMS is not currently supported, or is not installed at your site.

 

libname snow1 jdbc driver='net.snowflake.client.jdbc.SnowflakeDriver'
classpath='/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar'
URL='jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com/?authenticator=SNOWFLAKE_JWT&private_key_file=/home/user/rsa_key.p8&private_key_file_pwd=mypwd
&user=user@mycompany.com&db=DB_NAME&schema=SCHEMA_NAME'
schema='SCHEMA_NAME'
;

ERROR: Error trying to establish connection: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid
or not supported: /home/user/rsa_key.p8: /home/user/rsa_key.p8
ERROR: Error in the LIBNAME statement.

 

libname snow1 jdbc driver='net.snowflake.client.jdbc.SnowflakeDriver'
classpath='/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar'
URL='jdbc:snowflake://poc.east-us-2.azure.snowflakecomputing.com'
user="user"
authenticator=SNOWFLAKE_JWT 
private_key_file='/home/user/rsa_key.p8'
private_key_file_pwd='mypwd' 
classpath="/sas/scripts/snowflake/snowflake-jdbc-3.13.5.jar"
schema='SCHEMA_NAME';

ERROR 22-7: Invalid option name AUTHENTICATOR.
ERROR 22-7: Invalid option name PRIVATE_KEY_FILE.
ERROR 22-7: Invalid option name PRIVATE_KEY_FILE_PWD.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

The second one is the closest, the others use unsupported syntax.

You can use the libname in proc sql by coding:

libname SNOW1 jdbc ...;
proc sql;
 connect using SNOW1;

I suppose the break before &user= is not in the program?

The syntax seems correct according to this page.

Now the only issue remaining seems to be the private key: snowflake rejects it.

What do the snowflake admins see?

I suggest you open a SAS Tech support incident so you can get guidance directly from the snowflake developers.

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

The second one is the closest, the others use unsupported syntax.

You can use the libname in proc sql by coding:

libname SNOW1 jdbc ...;
proc sql;
 connect using SNOW1;

I suppose the break before &user= is not in the program?

The syntax seems correct according to this page.

Now the only issue remaining seems to be the private key: snowflake rejects it.

What do the snowflake admins see?

I suggest you open a SAS Tech support incident so you can get guidance directly from the snowflake developers.

jcamp
Calcite | Level 5

Thank you, yes the break before &user does not exist in the actual program. Based on your suggestion, I opened a SAS Tech support incident.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2080 views
  • 1 like
  • 2 in conversation