Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
NNot_defined1665392384
Contributor II
Contributor II

Error Connecting to Snowflake

Hi,

I can not connect to Snowflake from TOS 8.0.1. I have exhausted all options that I can conceive to connect to Snowflake:

1) Snowflake Connector: When I enter my credentials, which I tested from a python connector where they work, I get the following error (picture 1), however even more confusing to me is that connection seems to work as shown in (picture 2).

2) JDBC Connection: Again, I enter my credentials, test the connection, it works (pcture 3), but when i try to drag and drop the connection i get another error (picture 4)

3) Create a java function with the connection and import the .jar file (I leave the details out here, one of the previous methods has to work.)

One more detail: All the jobs that had components of step 1 and 2 including the DB Connections, Snowflake Connections and the jobs are all locked, thus i can't even delete them.

Labels (2)
5 Replies
Anonymous
Not applicable

Hello,

Could you also show us what is contained in the error log? What's JDK version are you using?

Best regards

Sabrina

NNot_defined1665392384
Contributor II
Contributor II
Author

Hi Sabrina,

 

sry for the late reply. I am using JDK 20 and this is the error that i am getting. However i should note that it might be related to the following issue: Save Failed!

 

What worked was the following function, which i executed in a tJavaRow component:

 

package routines;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.SQLException;

 

//import javax.naming.Context;

 

public class uploadData {

  public static void main(String jdbcUrl, String user, String password, String database, 

   String warehouse, String schema, String table, String CATEGORY, Integer CNT) {

 

    try {

      Class.forName("net.snowflake.client.jdbc.SnowflakeDriver");

      Connection connection = DriverManager.getConnection(jdbcUrl, user, password);

 

      String insertQuery = "INSERT INTO " + database + "." + schema + "." + table + " (CATEGORY, CNT) VALUES (?, ?)";

 

      PreparedStatement preparedStatement = connection.prepareStatement(insertQuery);     

      preparedStatement.setString(1, CATEGORY);

      preparedStatement.setInt(2, CNT);

 

      int rowsInserted = preparedStatement.executeUpdate();

      System.out.println(rowsInserted + " row(s) inserted.");

 

      preparedStatement.close();

      connection.close();

    } catch (ClassNotFoundException | SQLException e) {

      e.printStackTrace();

    }

  }

}

 

However it did require the addition of the tLibraryLoad component (which i got from another discussion):

 

0695b00000octB0AAI.png 

The error log file is attatch in the file attached to this post.

 

Anonymous
Not applicable

Hello,

Is there an error With Snowflake Metadata connection?

Please make sure there is not a firewall problem and your permission on schema set by DBA is OK with you.

Best regards

Sabrina

NNot_defined1665392384
Contributor II
Contributor II
Author

Not quite sure what you mean, but in the pictures it shows the test connection was successful.

Anonymous
Not applicable

Hello,

If I understand your issue very well, Test Connection Returns Success but you are getting the following message:

"Save Failed!"

As our team met a similar issue before, this error was related to permission on schema set by DBA. Also sometimes this error was thrown when user try to import metadata for too many tables at once. 

 We requested Snowflake DBA to set our permissions ( on the new schema ) same as "Public" schema and our team was able to save the metadata.

Hope this solution works for your use case.

Best regards

Sabrina