I had the same issue today.
Though the error message says what needs to be done:
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
One still needs additional information to fix this.
Get the exact driver from Pentaho's JDBC drivers reference.
Once you download it; put the appropriate .jars
in the lib
directory of Pentaho's tool. In my case, I'm using Spoon on windows
so the location would be:
C:\PathToWhereSpoonIsRunningFrom\pdi-ce-8.2.0.0-342\data-integration\lib
the files would be:
db2jcc.jar
db2jcc4.jar
db2jcc_license_cu.jar
Full error message:
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