GUACAMOLE-583: Correct SQLServer instance name property configuration.

This commit is contained in:
Virtually Nick
2020-06-16 09:55:56 -04:00
parent 6134dd3c88
commit 05f49b17cb

View File

@@ -70,16 +70,17 @@ public class SQLServerAuthenticationProviderModule implements Module {
myBatisProperties.setProperty("JDBC.username", environment.getSQLServerUsername()); myBatisProperties.setProperty("JDBC.username", environment.getSQLServerUsername());
myBatisProperties.setProperty("JDBC.password", environment.getSQLServerPassword()); myBatisProperties.setProperty("JDBC.password", environment.getSQLServerPassword());
String instance = environment.getSQLServerInstance();
if (instance != null)
myBatisProperties.setProperty("JDBC.instanceName", instance);
myBatisProperties.setProperty("JDBC.autoCommit", "false"); myBatisProperties.setProperty("JDBC.autoCommit", "false");
myBatisProperties.setProperty("mybatis.pooled.pingEnabled", "true"); myBatisProperties.setProperty("mybatis.pooled.pingEnabled", "true");
myBatisProperties.setProperty("mybatis.pooled.pingQuery", "SELECT 1"); myBatisProperties.setProperty("mybatis.pooled.pingQuery", "SELECT 1");
// Use UTF-8 in database // Use UTF-8 in database
driverProperties.setProperty("characterEncoding", "UTF-8"); driverProperties.setProperty("characterEncoding", "UTF-8");
// Retrieve instance name and set it
String instance = environment.getSQLServerInstance();
if (instance != null)
driverProperties.setProperty("JDBC.instanceName", instance);
// Capture which driver to use for the connection. // Capture which driver to use for the connection.
this.sqlServerDriver = environment.getSQLServerDriver(); this.sqlServerDriver = environment.getSQLServerDriver();