java.lang.ClassNotFoundException:在 Worklight 平台或项目中找不到类 com.ibm.db2.jcc.DB2Driver
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19128792/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java.lang.ClassNotFoundException: Class com.ibm.db2.jcc.DB2Driver not found in Worklight platform or project
提问by Mindan
I try to test an sql adapter that connects to db2 but I get the following result:
我尝试测试连接到 db2 的 sql 适配器,但得到以下结果:
java.lang.ClassNotFoundException: Class com.ibm.db2.jcc.DB2Driver not found in Worklight platform or project
java.lang.ClassNotFoundException:在 Worklight 平台或项目中找不到类 com.ibm.db2.jcc.DB2Driver
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?
知道出了什么问题吗?
采纳答案by Idan Adar
Do you mean that your Worklight database is DB2-based? If yes,
您的意思是您的 Worklight 数据库是基于 DB2 的吗?如果是,
- make sure to also edit worklight.properties with the correct DB2 setup
- 确保还使用正确的 DB2 设置编辑 worklight.properties
Also make sure that:
还要确保:
- the DB2 connector driver exists in the server\lib folder
- DB2 连接器驱动程序存在于 server\lib 文件夹中
回答by Ayanava Sarkar
Add the two jars:
添加两个罐子:
db2jcc.jar
db2jcc_license_cu.jar
db2jcc.jar
db2jcc_license_cu.jar
Add them to the libraries jar
folder.
将它们添加到库jar
文件夹中。