From 7915105e47eaf682406e4994d610a70bd18f19fb Mon Sep 17 00:00:00 2001 From: machavan Date: Wed, 1 Jan 2025 10:50:48 +0530 Subject: [PATCH] Fixed checking of APPLICATION_NAME in connect properties --- src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java index 12e2febb4..1ffffa6f0 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java @@ -1294,7 +1294,7 @@ public java.sql.Connection connect(String url, Properties suppliedProperties) th Properties connectProperties = parseAndMergeProperties(url, suppliedProperties); if (connectProperties != null) { result = DriverJDBCVersion.getSQLServerConnection(toString()); - if (suppliedProperties == null || (suppliedProperties != null && suppliedProperties.getProperty(SQLServerDriverStringProperty.APPLICATION_NAME.toString()) == null)) { + if (connectProperties.getProperty(SQLServerDriverStringProperty.APPLICATION_NAME.toString()) == null) { connectProperties.setProperty(SQLServerDriverStringProperty.APPLICATION_NAME.toString(), SQLServerDriver.constructedAppName); } result.connect(connectProperties, null);