Referencing .sql file, .jar file [message #686058] |
Tue, 21 June 2011 10:27  |
Eclipse User |
|
|
|
Hi,
I've designed a BIRT report which utilizes a scripted data source, which itself references an ArrayList<String[]> returned by a method in a Java class. The class gets its data from querying a database. The query is stored in a .sql file. Everything worked correctly, and the report was populated with data. But then I needed to upload my report to its desination, and I realized I'll have to also upload the SQL file (I could just hardcode it in the class but the query is quite lengthy- over 500 lines- part of the reason I'm using this convoluted method of querying the database). Here I ran into problems. The Java class itself still runs correctly, getting the data. However, the report won't run anymore. I tried including the .sql file in my JAR file, putting it in the workspace directory, etc, but when I try to preview the report I get
Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script ....
// (my open() script which calls a Java method)
({1}.at
......
....
...
..
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Caused by: org.eclipse.birt.data.engine.core.DataException: A BIRT exception occurred: Error evaluating Javascript expression. Script engine error: Wrapped java.sql.SQLException: JZ0S4: Cannot execute an empty (zero-length) query. (#3)
Script source: , line: 0, text:
__bm_OPEN(). See next exception for more information.
...
..
//more of the same
None of my scripts have changed- all I've altered is:
1)name of .sql file referenced in Java code.
2)Re-exported JAR file to reflect #1
Any ideas?
Thanks,
Daniel
|
|
|
|
|
Re: Referencing .sql file, .jar file [message #686635 is a reply to message #686113] |
Wed, 22 June 2011 12:22  |
Eclipse User |
|
|
|
Daniel,
While this reportContext.getResource("mysql.sql"); does return an absolute path it will change depending on how it is deployed and should still work. As long as the .sql file is in the resource directory it should not matter how you deploy it.
Jason
|
|
|
Powered by
FUDForum. Page generated in 0.26991 seconds