diff --git a/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPConnectionConfiguration.java b/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPConnectionConfiguration.java index 2e68c08591b0546d8e6098f1219e1654db857379..bdc279debc59437cc5aca9ab94600d3a5c1332c6 100644 --- a/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPConnectionConfiguration.java +++ b/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPConnectionConfiguration.java @@ -358,12 +358,18 @@ public class DBPConnectionConfiguration implements DBPObject } public void resolveSystemEnvironmentVariables() { - hostName = GeneralUtils.replaceSystemEnvironmentVariables(hostName); - hostPort = GeneralUtils.replaceSystemEnvironmentVariables(hostPort); - serverName = GeneralUtils.replaceSystemEnvironmentVariables(serverName); - databaseName = GeneralUtils.replaceSystemEnvironmentVariables(databaseName); - userName = GeneralUtils.replaceSystemEnvironmentVariables(userName); - userPassword = GeneralUtils.replaceSystemEnvironmentVariables(userPassword); - url = GeneralUtils.replaceSystemEnvironmentVariables(url); + hostName = hostName != null ? GeneralUtils.replaceSystemEnvironmentVariables(hostName) : null; + hostPort = hostPort != null ? GeneralUtils.replaceSystemEnvironmentVariables(hostPort) : null; + serverName = serverName != null ? GeneralUtils.replaceSystemEnvironmentVariables(serverName) : null; + databaseName = databaseName != null ? GeneralUtils.replaceSystemEnvironmentVariables(databaseName) : null; + userName = userName != null ? GeneralUtils.replaceSystemEnvironmentVariables(userName) : null; + userPassword = userPassword != null ? GeneralUtils.replaceSystemEnvironmentVariables(userPassword) : null; + url = url != null ? GeneralUtils.replaceSystemEnvironmentVariables(url) : null; + for (String prop : this.properties.keySet()) { + String value = this.properties.get(prop); + if (!CommonUtils.isEmpty(value)) { + this.properties.put(prop, GeneralUtils.replaceSystemEnvironmentVariables(value)); + } + } } } diff --git a/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/net/DBWHandlerConfiguration.java b/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/net/DBWHandlerConfiguration.java index 3351b507c6bfc35bb318831ed68638e8948d3d78..c20794fa189eef3201a12f1f3ecf5d0ddafbcf36 100644 --- a/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/net/DBWHandlerConfiguration.java +++ b/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/net/DBWHandlerConfiguration.java @@ -20,8 +20,6 @@ import org.jkiss.code.NotNull; import org.jkiss.code.Nullable; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.model.connection.DBPDriver; -import org.jkiss.dbeaver.model.impl.net.SSHConstants; -import org.jkiss.dbeaver.model.impl.net.SocksConstants; import org.jkiss.dbeaver.utils.GeneralUtils; import org.jkiss.utils.CommonUtils; @@ -157,9 +155,9 @@ public class DBWHandlerConfiguration { } public void resolveSystemEnvironmentVariables() { - userName = GeneralUtils.replaceSystemEnvironmentVariables(userName); - password = GeneralUtils.replaceSystemEnvironmentVariables(password); - for (String prop : new String[] {SSHConstants.PROP_HOST, SSHConstants.PROP_PORT, SocksConstants.PROP_HOST, SocksConstants.PROP_PORT}) { + userName = userName != null ? GeneralUtils.replaceSystemEnvironmentVariables(userName) : null; + password = password != null ? GeneralUtils.replaceSystemEnvironmentVariables(password) : null; + for (String prop : this.properties.keySet()) { String value = this.properties.get(prop); if (!CommonUtils.isEmpty(value)) { this.properties.put(prop, GeneralUtils.replaceSystemEnvironmentVariables(value));