Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All properties being converted to strings. #2286

Open
harveycggit opened this issue Jan 16, 2025 · 0 comments
Open

All properties being converted to strings. #2286

harveycggit opened this issue Jan 16, 2025 · 0 comments

Comments

@harveycggit
Copy link

In DriverDataSource line 49 all properties are getting converted to strings:

  for (var entry : properties.entrySet()) {
     driverProperties.setProperty(entry.getKey().toString(), entry.getValue().toString());
  }

This is an issue for the Snowflake driver because the only successful way to connect with an encrypted private key is to add the property "privateKey" with a value of an object of type java.security.PrivateKey. When that object gets converted to a string the connection fails with the following error:
Caused by: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Invalid parameter value type: java.lang.String, expected type: java.security.PrivateKey.

Changing the line to the following results in a successful connection:
for (var entry : properties.entrySet()) {
driverProperties.put(entry.getKey(), entry.getValue());
}

Can you advise? I hate to have to override the DriverDataSource class locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant