Skip to content

Commit

Permalink
Merge pull request #45448 from zakkak/2025-01-08-bumb-db2-jdbc
Browse files Browse the repository at this point in the history
Bump DB2 Driver to 12.1.0.0
  • Loading branch information
zakkak authored Jan 9, 2025
2 parents c183b3d + a23633a commit 1c42adb
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 95 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<adal4j.version>1.6.7</adal4j.version>
<oracle-jdbc.version>23.5.0.24.07</oracle-jdbc.version>
<derby-jdbc.version>10.16.1.1</derby-jdbc.version>
<db2-jdbc.version>11.5.8.0</db2-jdbc.version>
<db2-jdbc.version>12.1.0.0</db2-jdbc.version>
<shrinkwrap.version>1.2.6</shrinkwrap.version>
<hamcrest.version>2.2</hamcrest.version><!-- The version needs to be compatible with both REST Assured and Awaitility -->
<junit.jupiter.version>5.10.5</junit.jupiter.version>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<!-- Database images for JDBC/Reactive/Hibernate tests and devservices -->
<postgres.image>docker.io/postgres:17</postgres.image>
<mariadb.image>docker.io/mariadb:10.11</mariadb.image>
<db2.image>icr.io/db2_community/db2:11.5.9.0</db2.image>
<db2.image>icr.io/db2_community/db2:12.1.0.0</db2.image>
<mssql.image>mcr.microsoft.com/mssql/server:2022-latest</mssql.image>
<mysql.image>docker.io/mysql:8.4</mysql.image>
<oracle.image>docker.io/gvenzl/oracle-free:23-slim-faststart</oracle.image>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;

public class NioSocketImplProcessor {

// Workaround till https://github.com/oracle/graal/pull/10431 gets merged and backported to all supported versions
@BuildStep
RuntimeInitializedClassBuildItem reinitializeClass() {
return new RuntimeInitializedClassBuildItem("sun.nio.ch.NioSocketImpl");
}

}
5 changes: 0 additions & 5 deletions extensions/jdbc/jdbc-db2/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.transformer</groupId>
<artifactId>org.eclipse.transformer</artifactId>
<version>0.5.0</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.quarkus.deployment.builditem.NativeImageEnableAllCharsetsBuildItem;
import io.quarkus.deployment.builditem.SslNativeConfigBuildItem;
import io.quarkus.deployment.builditem.nativeimage.JPMSExportBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageAllowIncompleteClasspathBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageConfigBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
Expand Down Expand Up @@ -117,6 +118,14 @@ void registerServiceBinding(Capabilities capabilities,
dbKind.produce(new DefaultDataSourceDbKindBuildItem(DatabaseKind.DB2));
}

@BuildStep
NativeImageAllowIncompleteClasspathBuildItem allowIncompleteClasspath() {
// The DB2 JDBC driver uses reflection to load classes that are not present in the classpath
// Without it, the following error is thrown:
// Discovered unresolved type during parsing: com.ibm.db2.jcc.licenses.ConParam. This error is reported at image build time because class com.ibm.db2.jcc.am.Connection is registered for linking at image build time by command line and command line.
return new NativeImageAllowIncompleteClasspathBuildItem(Feature.JDBC_DB2.getName());
}

@BuildStep
void addExportsToNativeImage(BuildProducer<JPMSExportBuildItem> jpmsExports) {
// com.ibm.db2:jcc:11.5.6.0 accesses sun.security.action.GetPropertyAction
Expand Down

This file was deleted.

0 comments on commit 1c42adb

Please sign in to comment.