JDBC ODBC connection setup
Hello,<br />
I am relatively inexperienced with BIRT and I have what I believe is a configuration issue with BIRT which I'm hoping someone can help me sort out.<br />
<br />
<strong class='bbc'>Background:</strong><br />
There's a lot but I'll do my best to keep it short. 2 years ago, I helped develop an Eclipse RCP application which integrates BIRT for generating reports based on a common database. This was part of an academic project; now I'm supporting it professionally after a roughly 2 year break. Unfortunately, while I did build the .rptdesign files, my experience with the actual setup and configuration of BIRT was extremely limited, so I'm a bit behind the curve with respect to that part.<br />
<br />
<strong class='bbc'>The Details:</strong><br />
Our BIRT installation runs against either a MySQL DB or a HSQLDB (depending on startup configuration params). To switch between the MySQL and HSQLDB DBs, we implemented a custom JDBC ODA Plugin (we also did it to add an encryption/decryption layer).<br />
<br />
<strong class='bbc'>The Problem:</strong><br />
The implementation we used worked 2 years ago. Now it doesn't, and I suspect it's a configuration issue. We developed it in eclipse 3.3 using BIRT 2.2; I've already had to change some of the configuration for the rest of the application to work, so I suspect this is the same problem.<br />
<br />
<strong class='bbc'>Problem Details:</strong><br />
The problem I'm trying to figure out right now is why, when configured to use MySQL (which we're just going to use 100% of the time), the report preview tool can't seem to load the mysql drivers. Here's what happens:<br />
<br />
In the x.report.core project, I open up the rptdesign folder, open one of the .rptdesign report specifications, switch to report design perspective, and click the Preview view. When I do this, all non-table data is displayed correctly, but I get errors for each table containing data. The errors are always the same, and are the following:<br />
<br />
...<br />
Caused by: org.eclipse.birt.data.engine.core.DataException: Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.<br />
Cannot load JDBC Driver class: com.mysql.jdbc.Driver.<br />
<br />
There's far more to the trace but these are the relevant lines. I know this because when I manually add the mysql drivers to the available drivers by doing <br />
<strong class='bbc'>New Data Source > JDBC Data Source > Manage Drivers > add the mysql driver jar</strong><br />
the problem is resolved. However, I don't want to do this; I am packaging the RCP application and distributing it, so pointing at a local copy of the relevant .jar file is not an extensible solution. What I want is for the mysql drivers to come up in the <strong class='bbc'> Driver Class </strong> drop-down box without manually adding the .jar. Again, this used to work, so I'm pretty sure it's a configuration issue I need to figure out.<br />
<br />
<strong class='bbc'> What I've done </strong><br />
I've added the mysql driver jar file as a dependency to pretty much every project that is at all related to the reporting part of the application. This includes:<br />
<br />
x.report.core (where the rptdesign folder resides)<br />
x.report.data.oda.jdbc (where the JDBC plugin extension code resides)<br />
x.report.feature (how BIRT is integrated into the RCP application-it is used as a workbench perspective)<br />
x.report.core.ui (where the plugin elements of the feature are defined)<br />
org.eclipse.birt.report.viewer (added for the server part of the system, should not be relevant to the RCP application)<br />
<br />
However, this (obviously) hasn't worked. For reference, the setup of the data sources that used to work are the following (taken from the properties tab when the data source is selected in Report Design perspective):<br />
ODA Data Source:<br />
-JDBC Driver Class : com.mysql.jdbc.Driver<br />
-JDBC Driver URL : jdbc:mysql://localhost/dbname<br />
<br />
I know that the database name, username & password are all correct because the data comes out correctly if I manually add the mysql drivers.<br />
<br />
Any help that anyone can provide to tell my why BIRT can't seem to find the mysql drivers when I've included it pretty much every place I can think of would be much appreciated. If anyone would like the fully stack trace of the exception I can provide that.