Refactor SELECT_METHOD in SQLServerConnection
Improvement | Refactor SELECT_METHOD in SQLServerConnection
@@ -1484,7 +1484,9 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
if (sPropValue == null)
sPropValue = SQLServerDriverStringProperty.SELECT_METHOD.getDefaultValue();
if ("cursor".equalsIgnoreCase(sPropValue) || "direct".equalsIgnoreCase(sPropValue)) {
- activeConnectionProperties.setProperty(sPropKey, 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};
@@ -1755,13 +1757,6 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
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
