I am trying to connect to a DB2 database via the JDBC driver. I added the following entry in my pom.xml
<!-- https://mvnrepository.com/artifact/com.ibm.db2/db2jcc_license_cu -->
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>9.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.ibm.db2/db2jcc -->
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc</artifactId>
<version>8.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.ibm.db2.jcc/db2jcc4 -->
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc4</artifactId>
<version>10.1</version>
</dependency>
But the maven build is failing with the following issue
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/ibm/db2/db2jcc_license_cu/9.7/db2jcc_license_cu-9.7.pom
[WARNING] The POM for com.ibm.db2:db2jcc_license_cu:jar:9.7 is missing, no dependency information available
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/ibm/db2/db2jcc/8.1/db2jcc-8.1.pom
[WARNING] The POM for com.ibm.db2:db2jcc:jar:8.1 is missing, no dependency information available
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/ibm/db2/jcc/db2jcc4/10.1/db2jcc4-10.1.pom
[WARNING] The POM for com.ibm.db2.jcc:db2jcc4:jar:10.1 is missing, no dependency information available
[ERROR] Failed to execute goal on project <somename>: Could not resolve dependencies for project
How should I add the dependency for DB2 driver in maven?
The DB2 java driver (Type 4 JDBC connector) has now (really for real) been published to maven central:
https://mvnrepository.com/artifact/com.ibm.db2/jcc
Include it as a dependency like so:
<!-- https://mvnrepository.com/artifact/com.ibm.db2/jcc -->
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<version>11.1.4.4</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With