From 4f2b627a2e0989dad858d7a8d954ead2b3c97504 Mon Sep 17 00:00:00 2001 From: Peter Bae Date: Tue, 12 Mar 2019 14:40:19 -0700 Subject: [PATCH 1/2] change for 981 --- .../com/microsoft/sqlserver/jdbc/SQLServerConnection.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java index 20cb35c99..344fe2463 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java @@ -1485,6 +1485,7 @@ Connection connectInternal(Properties propsIn, sPropValue = SQLServerDriverStringProperty.SELECT_METHOD.getDefaultValue(); if ("cursor".equalsIgnoreCase(sPropValue) || "direct".equalsIgnoreCase(sPropValue)) { activeConnectionProperties.setProperty(sPropKey, sPropValue.toLowerCase(Locale.ENGLISH)); + selectMethod = sPropValue.toLowerCase(Locale.ENGLISH); } else { MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_invalidselectMethod")); Object[] msgArgs = {sPropValue}; @@ -1755,13 +1756,6 @@ else if (0 == requestedPacketSize) sPropKey = SQLServerDriverBooleanProperty.XOPEN_STATES.toString(); xopenStates = booleanPropertyOn(sPropKey, activeConnectionProperties.getProperty(sPropKey)); - sPropKey = SQLServerDriverStringProperty.SELECT_METHOD.toString(); - selectMethod = null; - if (activeConnectionProperties.getProperty(sPropKey) != null - && activeConnectionProperties.getProperty(sPropKey).length() > 0) { - selectMethod = activeConnectionProperties.getProperty(sPropKey); - } - sPropKey = SQLServerDriverStringProperty.RESPONSE_BUFFERING.toString(); responseBuffering = null; if (activeConnectionProperties.getProperty(sPropKey) != null From d1cc78a8f4f3b3679248c4aecb17eee184e41da0 Mon Sep 17 00:00:00 2001 From: Peter Bae Date: Tue, 12 Mar 2019 15:24:58 -0700 Subject: [PATCH 2/2] use variable --- .../com/microsoft/sqlserver/jdbc/SQLServerConnection.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java index 344fe2463..51de4f44e 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java @@ -1484,8 +1484,9 @@ Connection connectInternal(Properties propsIn, if (sPropValue == null) sPropValue = SQLServerDriverStringProperty.SELECT_METHOD.getDefaultValue(); if ("cursor".equalsIgnoreCase(sPropValue) || "direct".equalsIgnoreCase(sPropValue)) { - activeConnectionProperties.setProperty(sPropKey, sPropValue.toLowerCase(Locale.ENGLISH)); - selectMethod = sPropValue.toLowerCase(Locale.ENGLISH); + sPropValue = sPropValue.toLowerCase(Locale.ENGLISH); + activeConnectionProperties.setProperty(sPropKey, sPropValue); + selectMethod = sPropValue; } else { MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_invalidselectMethod")); Object[] msgArgs = {sPropValue};