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

雨燕双飞 提交于 2020-01-01 05:43:07

问题


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?


回答1:


Do you mean that your Worklight database is DB2-based? If yes,

  • make sure to also edit worklight.properties with the correct DB2 setup

Also make sure that:

  • the DB2 connector driver exists in the server\lib folder



回答2:


Add the two jars:

db2jcc.jar
db2jcc_license_cu.jar

Add them to the libraries jar folder.



来源:https://stackoverflow.com/questions/19128792/java-lang-classnotfoundexception-class-com-ibm-db2-jcc-db2driver-not-found-in-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!