Skip to content

Commit

Permalink
Update MS SQL JDBC driver to 11.1.1.jre11
Browse files Browse the repository at this point in the history
Fixes #24009

Co-authored-by: George Gastaldi <gegastaldi@gmail.com>
  • Loading branch information
sschu and gastaldi committed May 4, 2022
1 parent a152f8c commit c0fe94b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 77 deletions.
45 changes: 1 addition & 44 deletions bom/application/pom.xml
Expand Up @@ -117,7 +117,7 @@
<postgresql-jdbc.version>42.3.3</postgresql-jdbc.version>
<mariadb-jdbc.version>3.0.4</mariadb-jdbc.version>
<mysql-jdbc.version>8.0.29</mysql-jdbc.version>
<mssql-jdbc.version>7.2.2.jre8</mssql-jdbc.version>
<mssql-jdbc.version>11.1.1.jre11-preview</mssql-jdbc.version>
<adal4j.version>1.6.7</adal4j.version>
<oracle-jdbc.version>21.5.0.0</oracle-jdbc.version>
<derby-jdbc.version>10.14.2.0</derby-jdbc.version>
Expand Down Expand Up @@ -4742,49 +4742,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>${adal4j.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.stephenc.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.nimbusds</groupId>
<artifactId>lang-tag</artifactId>
</exclusion>
<exclusion>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
</exclusion>
<exclusion>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.cronutils</groupId>
<artifactId>cron-utils</artifactId>
Expand Down
11 changes: 4 additions & 7 deletions extensions/jdbc/jdbc-mssql/runtime/pom.xml
Expand Up @@ -27,13 +27,6 @@
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<!--
adal4j isn't used directly but you need to have it around for compilation to succeed.
-->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
Expand All @@ -44,6 +37,10 @@
<artifactId>quarkus-kubernetes-service-binding</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
@@ -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;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;

@Substitute
static QuarkusSqlFedAuthToken getSqlFedAuthToken(QuarkusSqlFedAuthInfo fedAuthInfo, String user, String password,
String authenticationString) {
throw new IllegalStateException("Quarkus does not support Active Directory based authentication");
}
import javax.net.ssl.KeyManager;

@Substitute
static QuarkusSqlFedAuthToken getSqlFedAuthTokenIntegrated(QuarkusSqlFedAuthInfo fedAuthInfo, String authenticationString) {
throw new IllegalStateException("Quarkus does not support Active Directory based authentication");
}

}
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 {
Expand All @@ -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 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 QuarkusSqlFedAuthToken getMSIAuthToken(String resource, String msiClientId) {
throw new IllegalStateException("Quarkus does not support MSI based authentication");
private void setKeyVaultProvider(String keyStorePrincipalId, String keyStoreSecret) throws SQLServerException {
throw new IllegalStateException("Quarkus does not support Keyvault-based column encryption");
}

@Substitute
ArrayList<byte[]> initEnclaveParameters(SQLServerStatement statement, String userSql, String preparedTypeDefinitions,
QuarkusSqlParameter[] params, ArrayList<String> 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 {

}
}
Expand Up @@ -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

0 comments on commit c0fe94b

Please sign in to comment.