Having trouble connecting iReport (v 1.2.6) to Db2

I am unable to connect to the db2 database. Getting an error "Please check username and password. The DBMS is running". I am using iReport1.2.6 and I get this error even if I check the 'Save Password' option.

Any help to fix this would be appreciated.

PS: I am having db2java.jar in the classpath. Hope this is the right one.


Post Edited by hsbgowd at 06/15/2009 12:12

Post Edited by hsbgowd at 06/15/2009 12:15
hsbgowd's picture
Joined: Sep 18 2008 - 9:23pm
Last seen: 15 years 1 week ago

3 Answers:



You are using "the APP driver". The IBM DB2 App Driver is a type-2 JDBC driver. This means you must install the DB2 client classes (dlls) on your client. This is generally more difficult to use than type-4 drivers. It is generally delivered in db2java.zip. Is it intentional on your part?


I suggest that you use "the Universal driver". The IBM DB2 Universal Driver is a type-4 JDBC driver. The driver class is "com.ibm.db2.jcc.DB2Driver". The url will be exactly like the url you are using now. It is generally delivered in db2jcc.jar.



mdahlman's picture
Joined: Mar 13 2007 - 2:43am
Last seen: 8 years 10 months ago

Hi Matt,

Thanks a lot. It works now!

I did use the "com.ibm.db2.jcc.DB2Driver" driver after adding db2jcc.jar in the classpath. It was again giving an error that  classpath does not include the licence file "db2jcc_license_*.jar". So i added all remaining jars from the folder containing db2jcc.jar and bingo it works!!



hsbgowd's picture
Joined: Sep 18 2008 - 9:23pm
Last seen: 15 years 1 week ago

Hello Matt,

I am new to JasperReport. I am updating existing report. My report is a very old version of JasperReport since there is only xml file for the source. If I use most current version of iReport to build the report by copying xml to Jrxml, my java code: JRLoader.loadObject() complains " cannot load the jasper file"....

I tried all versions of iReport  from V3.5 to V0.2.0. Finally I found that iReport-0.2.2 seems work for me. But when I added DB2 to the connection, I encounted the same issue as hsbgowd had. I already add db2jcc.jar and db2jcc_license_cu.jar in my classpath. my db2 version is 8.1.7 also very old.

Could you please help me?

Thanks in advance.


weihuo's picture
Joined: Aug 13 2009 - 6:29am
Last seen: 14 years 1 month ago