Pentaho Spoon 由于缺少驱动程序(jar 文件)而无法连接到 IBM DB2 数据库
Posted
技术标签:
【中文标题】Pentaho Spoon 由于缺少驱动程序(jar 文件)而无法连接到 IBM DB2 数据库【英文标题】:Pentaho Spoon unable to connect to IBM DB2 database due to a missing'driver (jar file) 【发布时间】:2016-01-27 10:18:55 【问题描述】:我正在使用 Pentaho 的勺子。当我尝试连接到 IBM DB2 数据库时,出现以下错误
`找不到驱动程序类“com.ibm.db2.jcc.DB2Driver”,请确保安装了“IBM DB2”驱动程序(jar 文件)。 com.ibm.db2.jcc.DB2Driver
我在谷歌上搜索但找不到任何东西。
【问题讨论】:
【参考方案1】:IBM 数据服务器驱动程序可以从相关的support page 或overall download page 下载。可以通过 Google 或 DB2 Knowledge Center 找到这些链接。
【讨论】:
【参考方案2】:我今天遇到了同样的问题。 虽然错误消息说明了需要做什么:
Driver class 'com.ibm.db2.jcc.DB2Driver' could not be found, make sure the 'IBM DB2' driver (jar file) is installed.
com.ibm.db2.jcc.DB2Driver
仍然需要更多信息来解决此问题。
从 Pentaho 的 JDBC drivers reference. 获取确切的驱动程序
一旦你下载它;把合适的.jars
放到Pentaho工具的lib
目录下。就我而言,我在 Windows 上使用 Spoon
所以位置是:
C:\PathToWhereSpoonIsRunningFrom\pdi-ce-8.2.0.0-342\data-integration\lib
文件将是:
db2jcc.jar
db2jcc4.jar
db2jcc_license_cu.jar
完整的错误信息:
Error connecting to database [Your_Database_Connection_Name] :org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
Driver class 'com.ibm.db2.jcc.DB2Driver' could not be found, make sure the 'IBM DB2' driver (jar file) is installed.
com.ibm.db2.jcc.DB2Driver
org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
Driver class 'com.ibm.db2.jcc.DB2Driver' could not be found, make sure the 'IBM DB2' driver (jar file) is installed.
com.ibm.db2.jcc.DB2Driver
at org.pentaho.di.core.database.Database.normalConnect(Database.java:472)
at org.pentaho.di.core.database.Database.connect(Database.java:370)
at org.pentaho.di.core.database.Database.connect(Database.java:341)
.
.
.
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
Driver class 'com.ibm.db2.jcc.DB2Driver' could not be found, make sure the 'IBM DB2' driver (jar file) is installed.
com.ibm.db2.jcc.DB2Driver
at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:515)
at org.pentaho.di.core.database.Database.normalConnect(Database.java:456)
... 56 more
Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:490)
... 57 more
Hostname: YourHostname
Port: YourPortNumber
Database name: YourDBName
【讨论】:
以上是关于Pentaho Spoon 由于缺少驱动程序(jar 文件)而无法连接到 IBM DB2 数据库的主要内容,如果未能解决你的问题,请参考以下文章