Can not connect to database via JDBC

Normally when you’re generating data in BIRT, you use a Cohga Weave Oda Data Source and have BIRT connect to Weave to generate the required data.

 

However, there may be situations when you require BIRT to directly connect to the database to retrieve the required data. This is done using a JDBC Data Source.

This requires installation of the appropriate JDBC driver to allow BIRT to connect to the database. Such drivers are installed via the Manage Drivers… button when adding the new JDBC Data Source.

This will copy the JDBC driver to the correct directory within the BIRT Designer and make it available while you’re designing the report. What it won’t do is make the JDBC driver available for the Weave server when generating the report.

If you’re going to directly connect to a database via JDBC from a BIRT report you also need to manually copy the JDBC driver to the drivers directory in the BIRT ODA Driver plugin. Note that this is different from copying the JDBC driver to the …\platform\workspace\jdbc\ directory, which is where Weave will load the drivers from when it connects to the database (as opposed to BIRT connecting to the database).

The directory name for the BIRT ODA Driver plugin is …\birt\plugins\org.eclipse.birt.report.data.oda.jdbc_X.Y.Z.vTIMESTAMP\drivers\ (where X.Y.Z.vTIMESTAMP will be different depending upon the version of BIRT). If you copy the required JDBC .jar file to that directory BIRT will then be able to load the driver when it needs to connect to the database, it could do this to load values for a list parameter in the report, or to directly generate the data for the report, for example.