diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java index 966718833..76eabac63 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java @@ -1311,7 +1311,7 @@ private int findColumn(String columnName) throws SQLServerException { // handle `@name` as well as `name`, since `@name` is what's returned // by DatabaseMetaData#getProcedureColumns String columnNameWithoutAtSign = null; - if (columnName.charAt(0) == '@') { + if (columnName.startsWith("@")) { columnNameWithoutAtSign = columnName.substring(1, columnName.length()); } else { columnNameWithoutAtSign = columnName; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java index 2fe9dfde0..2cfe72ca0 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java @@ -3930,7 +3930,7 @@ final void processEnvChange(TDSReader tdsReader) throws SQLServerException { String currentHostName = activeConnectionProperties.getProperty("hostNameInCertificate"); // skip the check for hostNameInCertificate if routingServerName is null - if (null != currentHostName && currentHostName.charAt(0) == '*' && (null != routingServerName) + if (null != currentHostName && currentHostName.startsWith("*") && (null != routingServerName) && routingServerName.indexOf('.') != -1) { char[] currentHostNameCharArray = currentHostName.toCharArray(); char[] routingServerNameCharArray = routingServerName.toCharArray();