Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ public Connection createConnection(String queryString, Properties info)
Properties properties = new Properties(info);
properties.put("user", this.getUsername());
properties.put("password", this.getPassword());
properties.putAll(info);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes little sense to have the properties constructed with info if we already add all its properties.

Copy link

@findinpath findinpath Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix makes sense

public class TestProperties
{
    public static void main(String[] args)
    {
        Properties properties = new Properties();
        properties.setProperty("key1", "value1");
        properties.setProperty("key2", "value2");
        properties.forEach((k, v) -> System.out.println(k + ": " + v));

        System.out.println("--- After Copy ---");

        Properties newProperties  = new Properties(properties);
        newProperties.forEach((k, v) -> System.out.println(k + ": " + v));


        System.out.println("--- Defaults ---");
        System.out.println(newProperties.getProperty("key1"));
        System.out.println(newProperties.getProperty("unknown"));

    }
}

final String url = constructUrlForConnection(queryString);

final Driver jdbcDriverInstance = getJdbcDriverInstance();
Expand Down