Introduction
This article describes how to resolve connection issues when using the External Database Connector with Snowflake in Java 17 or Java 21 environments.
Environment
- External Database Connector (all versions)
Instructions/Procedure
When using the External Database Connector with Snowflake in Java 17 or 21 environments, the following errors may occur:
For Java 17:
net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver internal error: exception creating result java.lang.NoClassDefFoundError: Could not initialize class net.snowflake.client.jdbc.internal.apache.arrow.memory.RootAllocatorFor Java 21:
net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver internal error: exception creating result java.lang.ExceptionInInitializerError
These errors occur due to compatibility issues with the Apache Arrow result format. To resolve this, the JDBC query result format needs to be changed to JSON at the Snowflake user level as follows:
- Connect to the Snowflake instance.
-
Execute the following SQL command to change the JDBC query result format:
ALTER USER <user_name> SET JDBC_QUERY_RESULT_FORMAT='JSON'; - Restart the application to apply the changes.
To revert these changes if needed, execute:
ALTER USER <user_name> UNSET JDBC_QUERY_RESULT_FORMAT;
Outcome
After applying these changes, the External Database Connector will successfully connect to Snowflake and execute queries in Java 17 or 21 environments.
Internal information related
- 234229, 228650
- C02SSNWKKH8/p1732623470330059
Additional information
Other documentation: Getting java.lang.NoClassDefFoundError for class RootAllocator
0 Comments