|
|
|
|
|
|
|
|
|
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #636214 is a reply to message #636199] |
Fri, 29 October 2010 16:18 |
|
Have you tried using property binding to change the jarList property at
runtime? Or a beforeOpen script similar to this:
if(
!reportContext.getHttpServletRequest().getAttribute("attributeBean ").isDesigner()
){
rp =
reportContext.getHttpServletRequest().getSession().getServle tContext().getRealPath( "/myapp");
rp = rp + "/myjar.jar";
this.setExtensionProperty("jarList",rp);
}
Jason
On 10/29/2010 11:43 AM, bluish wrote:
> Linda (or anyone else),
> you said "it looks for the JDBC driver from the path specified in the
> jarList data source property". Yes I know this property. The problem is:
> how can I specify a relative path? It seems you can only indicate an
> absolute path. This reduces the portability of the report.
> Thanku!
|
|
|
|
|
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639716 is a reply to message #636240] |
Wed, 17 November 2010 15:15 |
|
Hello, I'm back!
I tried the solutions proposed by Linda in the page
http://www.eclipse.org/forums/index.php?t=msg&goto=36893 9& .
Expecially I think this one fits best in my case:
Quote: | 1) The JavaScript expression can refer to any BIRT config[] variable. For example,
config[ "birt.viewer.working.path" ] + "../../data/myProfiles.dat"
|
So in "Edit Data Source", in "Property Binding", as "JDBC Driver JAR List" I put config[ "birt.viewer.working.path" ] + "jt400.jar" .
Debugging config["birt.viewer.working.path"], I saw that, working in the Eclipse designer, its " C:\Users\xxx\workspace-eclipse\.metadata\.plugins\org.eclips e.birt.report.viewer ". I put my jt400.jar there.
Unfortunately I had to specify a JAR List path for my driver. So In the same window, in "JDBC Driver and Connection Details" I clicked in the triangle button; in the new window in the "JAR List" tab I added the entry "C:/temp/jt400.jar". I placed another copy of my jar in that folder, hoping not to use it.
I saved. Ran preview and worked, ran the report in birt-viewer and worked. But if I remove jt400.jar from "C:/temp" it doesn't work. It seems it doesn't care of our config[ "birt.viewer.working.path" ] + "jt400.jar" I tried adding a slash/backslash before "jt400.jar" or putting it in a nested folder... nothing.
I hope you can help me. Thanks!
|
|
|
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639773 is a reply to message #639716] |
Wed, 17 November 2010 17:42 |
|
In the expression for the property binding could you add something like:
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/checkpath.txt", true ) );
out.println( config[ "birt.viewer.working.path" ] + "jt400.jar");
out.close();
add this to the top of the expression. Expressions always return the
last line. You may also want to try setting the value in the beforeOpen
script of the datasource.
var rp = config[ "birt.viewer.working.path" ]+ "/jt400.jar";
this.setExtensionProperty("jarList",rp);
Jason
On 11/17/2010 10:15 AM, bluish wrote:
> Hello, I'm back!
> I tried the solutions proposed by Linda in the page
> http://www.eclipse.org/forums/index.php?t=msg&goto=36893 9& .
> Expecially I think this one fits best in my case:
> Quote:
>> 1) The JavaScript expression can refer to any BIRT config[] variable.
>> For example, config[ "birt.viewer.working.path" ] +
>> "../../data/myProfiles.dat"
>
>
> So in "Edit Data Source", in "Property Binding", as "JDBC Driver JAR
> List" I put config[ "birt.viewer.working.path" ] + "jt400.jar".
> Debugging config["birt.viewer.working.path"], I saw that, working in the
> Eclipse designer, its "
> C:\Users\xxx\workspace-eclipse\.metadata\.plugins\org.eclips
> e.birt.report.viewer ". I put my jt400.jar there.
>
> Unfortunately I had to specify a JAR List path for my driver. So In the
> same window, in "JDBC Driver and Connection Details" I clicked in the
> triangle button; in the new window in the "JAR List" tab I added the
> entry "C:/temp/jt400.jar". I placed another copy of my jar in that
> folder, hoping not to use it.
>
> I saved. Ran preview and worked, ran the report in birt-viewer and
> worked. But if I remove jt400.jar from "C:/temp" it doesn't work. It
> seems it doesn't care of our config[ "birt.viewer.working.path" ] +
> "jt400.jar" I tried adding a slash/backslash before "jt400.jar" or
> putting it in a nested folder... nothing.
>
> I hope you can help me. Thanks!
|
|
|
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639862 is a reply to message #639773] |
Thu, 18 November 2010 08:03 |
|
This one, in the property binding, works:
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/checkpath.txt", true ) );
out.println( config[ "birt.viewer.working.path" ] + "jt400.jar");
out.close();
This one too:
var rp = config[ "birt.viewer.working.path" ]+ "/jt400.jar";
this.setExtensionProperty("jarList",rp);
But are instruction without any real effect. It seems that BIRT doesn't care of the JarList property, because the erro is always the same:
Table (id = 285):
+ An exception occurred during processing. Please see the following message for details:
Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile.
org.eclipse.datatools.connectivity.oda.OdaException ;
java.lang.ClassNotFoundException: com.ibm.as400.access.AS400JDBCDriver
That is it doesn't find C:/temp/jt400.jar.
I attach a screenshot, if it succeds..
|
|
|
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639892 is a reply to message #639862] |
Thu, 18 November 2010 10:00 |
|
I'm happy to tell you I found the solution!
My way of creating a data source was using "JDBC Database Connection for Query Builder". In this way I must specify a location for the jar containing the driver.
Instead if I use the way "JDBC Data Source" I only have to indicate the driver class, that is "com.ibm.as400.access.AS400JDBCDriver" in my case.
The other step (maybe it comes first) is putting jt400.jar in
C:\Program Files (x86)\eclipse-reporting-helios-SR1-win32-x86_64\eclipse\plugins\org.eclipse.birt.report.data.oda.jdbc_2.6.1.v20100909\drivers for the Eclipse birt-viewer plugin
and into
C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\birt-viewer\WEB-INF\lib for the birt-viewer web application.
These 2 environments search in these places for DB drivers, this is what seems to happen.
I'm so happy I found the solution. I hope this could help someone else. Thanks to everyone!
|
|
|
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639975 is a reply to message #639892] |
Thu, 18 November 2010 15:02 |
|
Thanks for posting the solution.
Jason
On 11/18/2010 5:00 AM, bluish wrote:
> I'm happy to tell you I found the solution!
>
> My way of creating a data source was using "JDBC Database Connection for
> Query Builder". In this way I must specify a location for the jar
> containing the driver.
>
> Instead if I use the way "JDBC Data Source" I only have to indicate the
> driver class, that is "com.ibm.as400.access.AS400JDBCDriver" in my case.
>
> The other step (maybe it comes first) is putting jt400.jar in
> C:\Program Files
> (x86)\eclipse-reporting-helios-SR1-win32-x86_64\eclipse\plug ins\org.eclipse.birt.report.data.oda.jdbc_2.6.1.v20100909\dr iversfor
> the Eclipse birt-viewer plugin
>
> and into
> C:\Program Files\Apache Software Foundation\Tomcat
> 7.0\webapps\birt-viewer\WEB-INF\libfor the birt-viewer web application.
>
> These 2 environments search in these places for DB drivers, this is what
> seems to happen.
>
> I'm so happy I found the solution. I hope this could help someone else.
> Thanks to everyone!
|
|
|
Powered by
FUDForum. Page generated in 0.05358 seconds