'HHH000339: Could not obtain connection metadata net.snowflake.client.jdbc.SnowflakeLoggedFeatureNotSupportedException

Getting exception in spring boot while connecting snowflake:**

```2021-12-22 17:14:24.956  WARN 43624 --- [           main] o.h.e.j.e.i.JdbcEnvironmentInitiator     : HHH000339: Could not obtain connection metadata: net.snowflake.client.jdbc.SnowflakeLoggedFeatureNotSupportedException

net.snowflake.client.jdbc.SnowflakeLoggedFeatureNotSupportedException: null
    at net.snowflake.client.jdbc.SnowflakeDatabaseMetaData.getSQLStateType(SnowflakeDatabaseMetaData.java:2774) ~[snowflake-jdbc-3.13.12.jar:3.13.12]```

Connection Details:

     spring.datasource.password={}
     spring.datasource.driverClassName=net.snowflake.client.jdbc.SnowflakeDriver
     spring.datasource.url=jdbc:snowflake://{}.snowflakecomputing.com/? 
     private_key_file=&private_key_file_pwd=&db=&warehouse=&schema=public
    spring.jpa.properties.hibernate.dialect=com.example.demo_snowflex_springboot.EmptyDialect
     spring.jpa.properties.hibernate.jdbc.batch_size=10
     spring.jpa.properties.hibernate.order_inserts=true
     spring.jpa.hibernate.naming.physical- strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl```


Solution 1:[1]

I have downgraded the starter parent(spring-boot-starter-parent) version to 2.2.5.RELEASE and could make the connection. Not sure about the rootcause.

Solution 2:[2]

Try the following Configuration:

spring.datasource.username=${snowflake.username}
spring.datasource.password=${snowflake.password}
    spring.datasource.driverClassName=net.snowflake.client.jdbc.SnowflakeDriver
    spring.datasource.url=jdbc:snowflake://${snowflake.account}.snowflakecomputing.com/?warehouse=${snowflake.warehouse}&db=${snowflake.database.name}&schema=${snowflake.schema}&TIMEZONE=${snowflake.timezone:UTC}&CLIENT_RESULT_COLUMN_CASE_INSENSITIVE=true&CLIENT_TIMESTAMP_TYPE_MAPPING=TIMESTAMP_NTZ
     
    spring.jpa.properties.hibernate.dialect=my.company.repositories.EmptyDialect
spring.jpa.properties.hibernate.jdbc.batch_size=10
spring.jpa.properties.hibernate.order_inserts=true

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Balaji
Solution 2 Dharman