Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Help with scripted data source - MySQL
bryantd
Hi,
I would greatly appreciate some help with this issue, I've been hammering on it for hours.
What I want to do at a high-level:
Run several queries against a MySQL database, process results and stick them in a list, present list contents via BIRT. My approach is to use Java objects to run the queries, then use a scripted data source in BIRT to handle the results.
What I've done:
I've created a Java class with a method that runs the MySQL queries, processes the results, and packages the results in a list. I'm using the JDBC driver, downloaded from the MySQL website.
When I debug this class outside of BIRT, everything works fine. The connection is made successfully, all queries are successful, and the correct list is returned as expected.
I then set up the appropriate data source and data set in BIRT, overriding the open and fetch scripts on the data set.
Here's where things break down.
As I mentioned, when I run my MySQL connector class method on its own everything works fine. However, when I invoke it through BIRT an exception occurs on the driver line:
Class.forName("com.mysql.jdbc.Driver").newInstance();
Passing the data to BIRT works fine if I pass 'fake' data that doesn't actually require a MySQL connection. But, as soon as I try to access the MySQL database (which, again, works perfectly fine outside of BIRT) it skips to the 'catch' block on the statement I listed above.
In summary, for some reason when BIRT invokes my Java code to connect to a MySQL database an error occurs.
Any help would be greatly appreciated.
--
Doug
Find more posts tagged with
Comments
bryantd
Got the scripted data source working - IN DATA SET PREVIEW ONLY - by copying the JDBC driver .jar file to the path:
C:Program Fileseclipsepluginsorg.eclipse.birt.report.data.oda.jdbc_2.5.0.v20090605drivers
However, it still will not render in the report preview tab or when I run -> view report.
Is there some other place(s) that I need to copy the driver .jar to?
--
Doug