Correct SQLServer instance name property configuration.
@@ -70,10 +70,6 @@ public class SQLServerAuthenticationProviderModule implements Module {
myBatisProperties.setProperty("JDBC.username", environment.getSQLServerUsername());
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("mybatis.pooled.pingEnabled", "true");
myBatisProperties.setProperty("mybatis.pooled.pingQuery", "SELECT 1");
@@ -81,6 +77,11 @@ public class SQLServerAuthenticationProviderModule implements Module {
// Use UTF-8 in database
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.
this.sqlServerDriver = environment.getSQLServerDriver();
