Home
Analytics
Exception: Cannot fetch the next data row
riyaz_itls
Hi,<br />
<br />
Am using BIRT 3.7.0<br />
<br />
I have a JDBC DataSet. If the SQL query in the dataset returns 0 rows BIRT throws the following exception. Logically this is not an exception condition. If the query returns 0 rows my report should shown an empty table rather than throwing an exception.<br />
<br />
Is there a way to suppress this exception?<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot fetch the next data row.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot move down to next row in the result set.
SQL error #1:[jcc][t4][10120][10898][3.58.82] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null ;
com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][3.58.82] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.newException(ExceptionHandler.java:52)
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:108)
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:84)
at org.eclipse.birt.data.engine.odaconsumer.ResultSet.fetch(ResultSet.java:143)
at org.eclipse.birt.data.engine.executor.cache.OdiAdapter.fetch(OdiAdapter.java:214)
at org.eclipse.birt.data.engine.executor.cache.RowResultSet.next(RowResultSet.java:105)
at org.eclipse.birt.data.engine.executor.cache.RowResultSet.getNext(RowResultSet.java:192)
at org.eclipse.birt.data.engine.executor.transform.SimpleResultSet.initialize(SimpleResultSet.java:133)
at org.eclipse.birt.data.engine.executor.transform.SimpleResultSet.<init>(SimpleResultSet.java:108)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:1009)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:441)
at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:1495)
at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:232)
at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:173)
at org.eclipse.birt.report.engine.api.impl.ExtractionResults.nextResultIterator(ExtractionResults.java:74)
at org.eclipse.birt.report.designer.data.ui.dataset.DataSetPreviewer.preview(DataSetPreviewer.java:70)
at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage$5.run(ResultSetPreviewPage.java:337)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot move down to next row in the result set.
SQL error #1:[jcc][t4][10120][10898][3.58.82] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null ;
com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][3.58.82] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
at org.eclipse.birt.report.data.oda.jdbc.ResultSet.next(ResultSet.java:196)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaResultSet.next(OdaResultSet.java:180)
at org.eclipse.birt.data.engine.odaconsumer.ResultSet.fetch(ResultSet.java:138)
... 14 more
Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][3.58.82] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
at com.ibm.db2.jcc.am.ed.a(ed.java:660)
at com.ibm.db2.jcc.am.ed.a(ed.java:60)
at com.ibm.db2.jcc.am.ed.a(ed.java:103)
at com.ibm.db2.jcc.am.hm.Db(hm.java:4352)
at com.ibm.db2.jcc.am.hm.c(hm.java:325)
at com.ibm.db2.jcc.am.hm.next(hm.java:304)
at org.eclipse.birt.report.data.oda.jdbc.ResultSet.next(ResultSet.java:187)
... 16 more
</pre>
Find more posts tagged with
Comments
mwilliams
Take a look at this:
http://www-01.ibm.com/support/docview.wss?uid=swg21461670
riyaz_itls
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="98664" data-time="1333682135" data-date="05 April 2012 - 08:15 PM"><p>
Take a look at this:<br />
<br />
<a class='bbc_url' href='
http://www-01.ibm.com/support/docview.wss?uid=swg21461670'>http://www-01.ibm.com/support/docview.wss?uid=swg21461670</a><br
/></p></blockquote>
<br />
Thank You Michael
gauglerb
<blockquote class='ipsBlockquote' data-author="'riyaz_itls'" data-cid="98810" data-time="1334125243" data-date="10 April 2012 - 11:20 PM"><p>
Thank You Michael<br /></p></blockquote>
<br />
OK thanks, that explains why it is happening, but what do you recommend as solution? Do we have to revert to some db2java.zip driver, (by the way, where can this be downloaded?) or is there a way in BIRT designs can use latest version of jdbc drivers and avoid this?
mwilliams
Did you try setting allowNextOnExhaustedResultSet to 1 (Yes)? You should be able to do this through your driver URL.
http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052342.html
gauglerb
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="116917" data-time="1368826191" data-date="17 May 2013 - 02:29 PM"><p>
Did you try setting allowNextOnExhaustedResultSet to 1 (Yes)? You should be able to do this through your driver URL.<br />
<br />
<a class='bbc_url' href='
http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052342.html'>http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052342.html</a><br
/></p></blockquote>
<br />
No I didn't realize I was supposed to- thanks, I will throw that in there now!
mwilliams
Let me know if it works for you.