0
votes

i added the followinig dependency for my project to connect to the database:

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

Since the connection to my database gets refused (ERRORCODE=-4499, SQLSTATE=08001) i tried to add a newer driver

    <dependency>
        <groupId>com.ibm.db2.jcc</groupId>
        <artifactId>db2jcc4</artifactId>
        <version>11.1</version>
        <scope>system</scope>
        <systemPath>${basedir}/lib/com/ibm/db2/jcc/db2jcc4/11.1/db2jcc4-11.1.jar</systemPath>
    </dependency>

I installed the jar with the maven install comand in my project directory. It created a lib folder with everything in it.

However i now get the following error:

Dependency for driver-class com.ibm.db2.jcc.DB2Driver is missing!

The maven project is definitly able to locate the jar-file.

1

1 Answers

0
votes

There is a second dependency you are missing :

<dependency>
    <groupId>com.ibm.db2</groupId>
    <artifactId>db2jcc_license_cu</artifactId>
    <version>11.1</version>
    <systemPath>${basedir}/lib/com/ibm/db2/jcc/db2jcc4/11.1/db2jcc_license_cu.jar</systemPath>
</dependency>

Found on nacho4d's blog