From c5849a044637f20098e230ece53863cd00f1ac43 Mon Sep 17 00:00:00 2001 From: ulvii Date: Fri, 4 Oct 2019 14:03:37 -0700 Subject: [PATCH] Performance | Disabled pattern matching when using CallableStatements and SQLServerParameterMetaData (#1149) --- .../microsoft/sqlserver/jdbc/SQLServerCallableStatement.java | 2 +- .../microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java index c773c9f80..cf22b6a43 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java @@ -1279,7 +1279,7 @@ private int findColumn(String columnName) throws SQLServerException { // we should always have a procedure name part metaQuery.append("@procedure_name="); metaQuery.append(threePartName.getProcedurePart()); - metaQuery.append(" , @ODBCVer=3"); + metaQuery.append(" , @ODBCVer=3, @fUsePattern=0"); } else { // This should rarely happen, this will only happen if we can't find the stored procedure name // invalidly formatted call syntax. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java index 876495f44..555221ffa 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java @@ -289,8 +289,8 @@ private void checkClosed() throws SQLServerException { try (SQLServerStatement s = (SQLServerStatement) con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); SQLServerResultSet rsProcedureMeta = s.executeQueryInternal( - con.isKatmaiOrLater() ? "exec sp_sproc_columns_100 " + sProc + ", @ODBCVer=3" - : "exec sp_sproc_columns " + sProc + ", @ODBCVer=3")) { + con.isKatmaiOrLater() ? "exec sp_sproc_columns_100 " + sProc + ", @ODBCVer=3, @fUsePattern=0" + : "exec sp_sproc_columns " + sProc + ", @ODBCVer=3, @fUsePattern=0")) { // if rsProcedureMeta has next row, it means the stored procedure is found if (rsProcedureMeta.next()) {