Home
Analytics
supply my own jdbc connection to birt report generation
liaojinmei
Our application is already using the jdbc driver which resides in tomcat's common/lib folder, I am wondering why I still need to put another copy of the jdbc driver in the platform/plugin/xxxx/dirver folder, is there a way that I can supply my own jdbc connection to the birt report regeneration?
Find more posts tagged with
Comments
JasonW
Yes, you can use JNDI or you can pass in the connection in serveral ways.<br />
Take a look at:<br />
<a class='bbc_url' href='
http://birtworld.blogspot.com/2008/11/birt-connection-pooling-continued-again.html'>BIRT
World: BIRT Connection Pooling Continued Again</a><br />
and<br />
<a class='bbc_url' href='
http://birtworld.blogspot.com/2007/01/birt-connection-pooling-continued.html'>BIRT
World: BIRT Connection Pooling Continued</a><br />
and<br />
<br />
<a class='bbc_url' href='
http://birtworld.blogspot.com/2005/12/using-supplied-connection-with-birt.html'>BIRT
World: Using a supplied connection with BIRT</a><br />
<br />
You can also set the cp for the db driver to use the one you already have by <br />
config.getAppContext().put("OdaJDBCDriverClassPath", "c:/birt/mysql/mysql-connector-java-5.0.4-bin.jar");<br />
You can set this in script in the beforeFactory like:<br />
reportContext.getAppContext().put("OdaJDBCDriverClassPath", "c:/birt/mysql/mysql-connector-java-5.0.4-bin.jar");<br />
<br />
Lasting you can pass in an open connection like<br />
task.getAppContext().put("OdaJDBCDriverPassInConnection", this.getConnection());
liaojinmei
Thank you so much. That's exactly what I need.