2

I am trying to access DB2 tables in a java project. I am able to access the tables when I manually added the jar files - db2jcc4.jar and db2jcc_license_cisuz.jar. No issues in accessing the tables.

But when I try to add these jar files through Maven, they won't add to the project.

<dependency>
    <groupId>com.ibm.db2</groupId>
    <artifactId>db2jcc4</artifactId>
    <version>9.7.0.4</version>
</dependency>

Error Message - Missing artifact id.

Also, the latest db2jcc4.jar files (Version 11.1) are not present in Maven repository. Is there any other place I can access it from?

Michael Lihs
  • 7,460
  • 17
  • 52
  • 85
  • Possible duplicate of https://stackoverflow.com/questions/15382561/adding-db2-jars-to-java-webapp-using-maven – mao Mar 14 '18 at 21:30

4 Answers4

4

You have to download the right driver from IBM. http://www-01.ibm.com/support/docview.wss?uid=swg21363866

Then install it to your local maven repository http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html

1

As written in maven central repository the artifact is in another repo. Add it to your pom and it will work.

<repositories>
    <repository>
        <id>Alfresco</id>
        <name>Alfresco</name>
        <url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
    </repository>
</repositories>
adex
  • 75
  • 10
1

Assuming that , using share drive is the option to go.

 <dependency>
            <groupId>com.ibm.db2.jcc</groupId>
            <artifactId>licences</artifactId>
            <version>0.7</version> <!-- Adjust this properly -->
            <scope>system</scope>
            <systemPath>R:\JDBC drivers\IBM DB2_db2_2.2.0.v20130525_0720\db2jcc_license_cisuz.jar</systemPath> 
        </dependency>
surendrapanday
  • 530
  • 3
  • 13
0

According to maven central repository the artifact is in another repository. Include these two in your pom.xml and it should work:

        <dependency>
            <groupId>com.ibm.db2.jcc</groupId>
            <artifactId>db2jcc4</artifactId>
            <version>10.1</version>
        </dependency>

   <repositories>
        <repository>
            <id>com.ibm.db2.jcc</id>
            <url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
        </repository>
    </repositories>
Armali
  • 18,255
  • 14
  • 57
  • 171
Gagan Gowda
  • 49
  • 1
  • 2