How to connect to DB2 databse from ireport 3.7.5

0

Hi

I am new to DB2 and have no idea on about DB2 drivers also. I have to connect to DB2 database using ireport and generate reports. Can anyone help me.

Its urgent.

Thanks in advance.

saisree.addagiri's picture
Joined: Jul 14 2015 - 12:39am
Last seen: 3 years 9 months ago

You can highlight the default IBM JDBC driver and then paste in com.ibm.db2.jcc.DB2Driver to change it to the right one. Also you don't need the db2java.jar that is the older version. Then test again. 

joel.carlson - 4 years 1 month ago

Hi Joel,

Issue resolved. I have removed db2java.jar and added only db2jcc, db2jcc_license_cu jars and connection was successful.

Thank you.

saisree.addagiri - 4 years 1 month ago

Hi

I have connected db2 database in services window. There it is loadinf all the tables and views, procedures in that database. However i am unable to get those tables in ireport. If i write any query with those tables it is giving error like table not found.

Please let me know the procedure for connecting db2 from ireport and from there reading data from that connection.

Its urgent.

 

saisree.addagiri - 4 years 1 month ago
show 1 more...

Hello, I Have  IReport 5.6.0

I can add the new DB2 JDBC Driver and even make a database connecttion in the services window, however, when I try to create a new connection that can be used In the reports, the DB2 driver does not apear,and in the "query builder" ireport, I cant get the tables..,

saisree.addagiri - 4 years 1 month ago

2 Answers:

1

Not sure if iReport 3.7.5 is the same as 5.6.0 but you need to upload the jar drivers in iReports. Tools - Options, Then under classpath tab upload the db2jcc.jar and the db2jcc_license_cu.jar. For you database connection click the button for a new connection and type a name for it, then type in com.ibm.db2.jcc.DB2Driver in JDBC Driver, for JDBC URL use jdbc:db2://{IP or hostname of server}:50000/{Database name} then enter your username and password and hit test. Should work.You should be able to find the jar files under {installation directory}/IBM/SQLLIB/java

joel.carlson's picture
Joined: Jul 23 2015 - 4:39pm
Last seen: 1 week 6 days ago
0

Hi Joel,

I tried as it is like you said in previous also. But still iam unable to connect to DB2 database. I got error like COM.ibm.db2.jdbc.app.DB2Driver class not found. I have added db2jcc.jar and db2jcc_license_cu.jar and db2java.jar files in ireport classpath(tools--->classpath).

I have also added db2java.jar file in ireport services under(Window menu) it is loading this class COM.ibm.db2.jdbc.app.DB2Driver.

But ireport was unable to load this class.

saisree.addagiri's picture
Joined: Jul 14 2015 - 12:39am
Last seen: 3 years 9 months ago
Feedback