java.lang.ClassNotFoundException: Class com.ibm.db2.jcc.DB2Driver not found in Worklight platform or project

Mindan picture Mindan · Oct 2, 2013 · Viewed 35.4k times · Source

I try to test an sql adapter that connects to db2 but I get the following result:

java.lang.ClassNotFoundException: Class com.ibm.db2.jcc.DB2Driver not found in Worklight platform or project

here is my code:

<dataSourceDefinition>
    <driverClass>com.ibm.db2.jcc.DB2Driver</driverClass>
    <url>jdbc:db2://localhost:50000/WLTEST</url>
    <user>db2admin</user>
    <password>db2admin</password> 
</dataSourceDefinition>

any idea what is going wrong?

Answer

Ayanava Sarkar picture Ayanava Sarkar · Jul 12, 2016

Add the two jars:

db2jcc.jar
db2jcc_license_cu.jar

Add them to the libraries jar folder.