From 8f92b016cee32acd45b362e0f2f5eccfc07dbc92 Mon Sep 17 00:00:00 2001 From: Sebastian Schuster Date: Mon, 28 Feb 2022 14:56:14 +0100 Subject: [PATCH] Update MS SQL JDBC driver to 11.1.1.jre11 Fixes #24009 Co-authored-by: George Gastaldi --- bom/application/pom.xml | 45 +------------ extensions/jdbc/jdbc-mssql/runtime/pom.xml | 7 +- .../jdbc/SQLServerJDBCSubstitutions.java | 66 +++++++++++-------- .../src/main/resources/application.properties | 1 + 4 files changed, 48 insertions(+), 71 deletions(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 2dfb8b8f178b26..287baa8f86a77e 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -120,7 +120,7 @@ 42.4.1 3.0.7 8.0.30 - 7.2.2.jre8 + 11.2.0.jre11 1.6.7 21.5.0.0 10.14.2.0 @@ -5052,49 +5052,6 @@ - - com.microsoft.azure - adal4j - ${adal4j.version} - - - org.apache.commons - commons-lang3 - - - com.sun.mail - javax.mail - - - com.github.stephenc.jcip - jcip-annotations - - - com.nimbusds - lang-tag - - - com.nimbusds - nimbus-jose-jwt - - - net.minidev - json-smart - - - com.google.code.gson - gson - - - org.slf4j - slf4j-api - - - commons-codec - commons-codec - - - com.cronutils cron-utils diff --git a/extensions/jdbc/jdbc-mssql/runtime/pom.xml b/extensions/jdbc/jdbc-mssql/runtime/pom.xml index bac87d358b766f..4ec06d801d305c 100644 --- a/extensions/jdbc/jdbc-mssql/runtime/pom.xml +++ b/extensions/jdbc/jdbc-mssql/runtime/pom.xml @@ -29,11 +29,12 @@ + com.microsoft.azure adal4j + --> org.graalvm.nativeimage svm @@ -44,6 +45,10 @@ quarkus-kubernetes-service-binding true + + org.antlr + antlr4-runtime + diff --git a/extensions/jdbc/jdbc-mssql/runtime/src/main/java/io/quarkus/jdbc/mssql/runtime/graal/com/microsoft/sqlserver/jdbc/SQLServerJDBCSubstitutions.java b/extensions/jdbc/jdbc-mssql/runtime/src/main/java/io/quarkus/jdbc/mssql/runtime/graal/com/microsoft/sqlserver/jdbc/SQLServerJDBCSubstitutions.java index 505f48c02a14ef..dbb21c9ab934e9 100644 --- a/extensions/jdbc/jdbc-mssql/runtime/src/main/java/io/quarkus/jdbc/mssql/runtime/graal/com/microsoft/sqlserver/jdbc/SQLServerJDBCSubstitutions.java +++ b/extensions/jdbc/jdbc-mssql/runtime/src/main/java/io/quarkus/jdbc/mssql/runtime/graal/com/microsoft/sqlserver/jdbc/SQLServerJDBCSubstitutions.java @@ -1,30 +1,15 @@ package io.quarkus.jdbc.mssql.runtime.graal.com.microsoft.sqlserver.jdbc; -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.RecomputeFieldValue; -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; - -@TargetClass(className = "com.microsoft.sqlserver.jdbc.SQLServerADAL4JUtils") -@Substitute -final class SQLServerADAL4JUtils { - - @Alias - @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) - static final private java.util.logging.Logger adal4jLogger = null; - - @Substitute - static QuarkusSqlFedAuthToken getSqlFedAuthToken(QuarkusSqlFedAuthInfo fedAuthInfo, String user, String password, - String authenticationString) { - throw new IllegalStateException("Quarkus does not support Active Directory based authentication"); - } +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.ArrayList; - @Substitute - static QuarkusSqlFedAuthToken getSqlFedAuthTokenIntegrated(QuarkusSqlFedAuthInfo fedAuthInfo, String authenticationString) { - throw new IllegalStateException("Quarkus does not support Active Directory based authentication"); - } +import javax.net.ssl.KeyManager; -} +import com.microsoft.sqlserver.jdbc.SQLServerException; +import com.microsoft.sqlserver.jdbc.SQLServerStatement; +import com.oracle.svm.core.annotate.Substitute; +import com.oracle.svm.core.annotate.TargetClass; @TargetClass(className = "com.microsoft.sqlserver.jdbc.SqlFedAuthToken") final class QuarkusSqlFedAuthToken { @@ -36,16 +21,45 @@ final class QuarkusSqlFedAuthInfo { } +@TargetClass(className = "com.microsoft.sqlserver.jdbc.Parameter") +final class QuarkusSqlParameter { + +} + @TargetClass(className = "com.microsoft.sqlserver.jdbc.SQLServerConnection") final class QuarkusSQLServerConnection { @Substitute - private QuarkusSqlFedAuthToken getMSIAuthToken(String resource, String msiClientId) { - throw new IllegalStateException("Quarkus does not support MSI based authentication"); + private QuarkusSqlFedAuthToken getFedAuthToken(QuarkusSqlFedAuthInfo fedAuthInfo) { + throw new IllegalStateException("Quarkus does not support Active Directory based authentication"); + } + + @Substitute + private void setKeyVaultProvider(String keyStorePrincipalId) throws SQLServerException { + throw new IllegalStateException("Quarkus does not support Keyvault-based column encryption"); + } + + @Substitute + private void setKeyVaultProvider(String keyStorePrincipalId, String keyStoreSecret) throws SQLServerException { + throw new IllegalStateException("Quarkus does not support Keyvault-based column encryption"); } + @Substitute + ArrayList initEnclaveParameters(SQLServerStatement statement, String userSql, String preparedTypeDefinitions, + QuarkusSqlParameter[] params, ArrayList parameterNames) throws SQLServerException { + throw new IllegalStateException("Quarkus does not support AAS Enclave"); + } +} + +@TargetClass(className = "com.microsoft.sqlserver.jdbc.SQLServerCertificateUtils") +final class QuarkusSqlSQLServerCertificateUtils { + @Substitute + static KeyManager[] getKeyManagerFromFile(String certPath, String keyPath, String keyPassword) + throws IOException, GeneralSecurityException, SQLServerException { + throw new IllegalStateException("Quarkus does not support Client Certificate based authentication"); + } } class SQLServerJDBCSubstitutions { -} \ No newline at end of file +} diff --git a/integration-tests/jpa-mssql/src/main/resources/application.properties b/integration-tests/jpa-mssql/src/main/resources/application.properties index 26899798e7fe27..f936ea0add580e 100644 --- a/integration-tests/jpa-mssql/src/main/resources/application.properties +++ b/integration-tests/jpa-mssql/src/main/resources/application.properties @@ -5,3 +5,4 @@ quarkus.datasource.jdbc.url=${mssqldb.url} quarkus.datasource.jdbc.max-size=8 quarkus.hibernate-orm.dialect=org.hibernate.dialect.SQLServer2012Dialect quarkus.hibernate-orm.database.generation=create +quarkus.datasource.jdbc.additional-jdbc-properties.trustServerCertificate=true