Skip to content

JDBC now requiring username to be passed with update to v0.2-10 #91

Description

@AlisonLanski

I am running the following code to connect directly to snowflake using a jdbc driver.

DBI::dbConnect(RJDBC::JDBC(driverClass = "net.snowflake.client.jdbc.SnowflakeDriver", 
                                   classPath = "[location]/snowflake-jdbc-3.13.18.jar"),
                "jdbc:snowflake://[web address]/?authenticator=externalbrowser")

With version 0.2-8, this code works: it opens a browser window to collect credentials and establishes a connection for use in queries.
With version 0.2-10, this code throws an error, does not open a browser window, and does not establish a working connection

The error is provided is:

Unable to connect JDBC to jdbc:snowflake://[web address]/?authenticator=externalbrowser
JDBC ERROR: JDBC driver internal error: missing user name for opening session.

The JDBC ERROR message appears to be coming from the driver code (https://github.com/snowflakedb/snowflake-jdbc/blob/master/src/main/java/net/snowflake/client/core/SessionUtil.java) line 254 at the time of this issue submission.

I have tested the code using the current driver/old jdbc drivers, the current version of DBI/older versions of DBI, and the current/older version of RJDBC (all combinations). The only time I get the error is when using the current version of RJDBC (versions of other items don't matter), so I assume something in the update from 2-8 to 2-10 changed how information is being collected or passed from the driver.

This can be solved in my code by adding an explicit username to the connection string.

"jdbc:snowflake://[web address]/?user=[username]&authenticator=externalbrowser"

Even so, I would prefer not to introduce a parameter to the code if it can be avoided. (This code is part of an internal package for many database connections). I'm not familiar enough with your scripts to pinpoint which change led to this behavioral difference and if it is actually desirable for some reason. I am hoping there is a solution within the RJDBC package which can prevent the need to add an explicit username to the connection string.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions