The following describes the steps required to add a new DB2 driver to the JReport environment.
- Download a DB2 driver from IBM. Go to http://www-01.ibm.com/support/docview.wss?uid=swg21363866, select a driver version, and then download and install the driver.
- Follow the standard DB2 configuration instructions to configure the driver: https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_t0010264.html.
- Add the driver to JReport Designer and JReport Server installations. Locate the JDBC library (for example, db2jcc4.jar) in your DB2 JDBC driver installation directories and copy it to the lib folder in the installation root directory of JReport Designer or JReport Server.
- Update the startup file <install_root>\bin\JReport.bat for JReport Designer or <install_root>\bin\JRserver.bat for JReport Server, by adding the following path as the first item in the classpath:
- Restart JReport Designer.
- Add new data source to JReport Designer and Server using newly installed JDBC driver. No additional work required for the server to connect to the DB2 database. Publishing the catalog to the server will provide the necessary information for JReport Server to connect to the DB2 database. The following details the steps in JReport Designer:
- Click New > Data Source.
- In the New Data Source dialog, select JDBC as the connection type and click OK.
- In the Get JDBC Connection Information dialog, enter connection parameters as follows:
- Click OK. You can then access the DB2 database to add tables, views and synonyms to the new data source.