Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Drop Down box parameters
DispatchMG
Hey all,<br />
I've created a report that allows a user to display all Orders in our eCommerce system that fall within a specified date range. When being asked to supply the parameters for the report, they also are asked to choose an order status from a drop-down box that is populated by another data set. I use the order status id as the drop-down value, and the displayed value, or label, for the drop-down is the order status name. All this looks good and appears to work well; the drop-down does contain the correct labels and ids. However, when choosing any option other than the already-selected one, BIRT somehow receives a null value. The log is below:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
!SESSION 2011-09-09 11:13:53.511
eclipse.buildId=unknown
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86
!ENTRY org.eclipse.ui 4 4 2011-09-09 12:23:36.463
!MESSAGE Invalid preference page path: Web Browser
!ENTRY org.eclipse.birt.data 4 1001 2011-09-09 16:01:17.097
!MESSAGE A BIRT exception occurred.
!STACK 0
org.eclipse.birt.data.engine.core.DataException: Failed to prepare the query execution for the data set: OrdersInDateRangeForOrderStatus
Cannot set a null value to parameter 3.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1: Parameter metadata not available for the given statement
;
java.sql.SQLException: Parameter metadata not available for the given statement
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:344)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:448)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:145)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:159)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:142)
at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:136)
at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:118)
at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:102)
at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getRuntimeMetaData(DataSetMetaDataHelper.java:193)
at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getRealMetaData(DataSetMetaDataHelper.java:152)
at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getDataSetMetaData(DataSetMetaDataHelper.java:114)
at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.refreshMetaData(DataSetMetaDataHelper.java:369)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.refreshMetaData(DataRequestSessionImpl.java:403)
at org.eclipse.birt.report.designer.data.ui.dataset.ExternalUIUtil.updateColumnCache(ExternalUIUtil.java:109)
at org.eclipse.birt.report.designer.data.ui.providers.DefaultDataServiceProvider.updateColumnCache(DefaultDataServiceProvider.java:96)
at org.eclipse.birt.report.designer.internal.ui.data.DataService.updateColumnCache(DataService.java:129)
at org.eclipse.birt.report.designer.data.ui.dataset.DataSetUIUtil.updateColumnCache(DataSetUIUtil.java:98)
at org.eclipse.birt.report.designer.data.ui.dataset.DataSetEditor.okPressed(DataSetEditor.java:684)
at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog.buttonPressed(AbstractPropertyDialog.java:646)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.birt.report.designer.ui.dialogs.BaseDialog.open(BaseDialog.java:111)
at org.eclipse.birt.report.designer.data.ui.providers.EditableDataSetNodeProvider.performEdit(EditableDataSetNodeProvider.java:99)
at org.eclipse.birt.report.designer.internal.ui.views.DefaultNodeProvider.performRequest(DefaultNodeProvider.java:442)
at org.eclipse.birt.report.designer.internal.ui.views.actions.EditAction.doAction(EditAction.java:90)
at org.eclipse.birt.report.designer.internal.ui.views.actions.AbstractElementAction.run(AbstractElementAction.java:70)
at org.eclipse.birt.report.designer.internal.ui.views.RenameListener.doubleClick(RenameListener.java:214)
at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:824)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:822)
at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1421)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1225)
at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:238)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:235)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:296)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.birt.report.designer.ui.rcp.DesignerApplication.run(DesignerApplication.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Caused by: org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot set a null value to parameter 3.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1: Parameter metadata not available for the given statement
;
java.sql.SQLException: Parameter metadata not available for the given statement
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.newException(ExceptionHandler.java:54)
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:108)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetNull(PreparedStatement.java:4651)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setNull(PreparedStatement.java:4173)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3113)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:982)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:555)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:285)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:441)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:340)
... 73 more
Caused by: org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1: Parameter metadata not available for the given statement
;
java.sql.SQLException: Parameter metadata not available for the given statement
at org.eclipse.birt.report.data.oda.jdbc.Statement.setNull(Statement.java:869)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.setNull(OdaQuery.java:1207)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetNull(PreparedStatement.java:4646)
... 81 more
Caused by: java.sql.SQLException: Parameter metadata not available for the given statement
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.MysqlParameterMetadata.checkAvailable(MysqlParameterMetadata.java:69)
at com.mysql.jdbc.MysqlParameterMetadata.getParameterType(MysqlParameterMetadata.java:118)
at org.eclipse.birt.report.data.oda.jdbc.Statement.setNull(Statement.java:864)
... 83 more
!SUBENTRY 1 org.eclipse.birt.data 1 1001 2011-09-09 16:01:17.098
!MESSAGE Plug-in Provider:Eclipse.org
!SUBENTRY 1 org.eclipse.birt.data 1 1001 2011-09-09 16:01:17.098
!MESSAGE Plug-in Name:BIRT Data Engine
!SUBENTRY 1 org.eclipse.birt.data 1 1001 2011-09-09 16:01:17.098
!MESSAGE Plug-in ID:org.eclipse.birt.data
!SUBENTRY 1 org.eclipse.birt.data 1 1001 2011-09-09 16:01:17.098
!MESSAGE Version:2.6.1.v20100915
!SUBENTRY 1 org.eclipse.birt.data 4 1001 2011-09-09 16:01:17.098
!MESSAGE Error Code:data.engine.fail.prepareExecution
!SUBENTRY 1 org.eclipse.birt.data 4 1001 2011-09-09 16:01:17.098
!MESSAGE Error Message:Failed to prepare the query execution for the data set: OrdersInDateRangeForOrderStatus
Cannot set a null value to parameter 3.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1: Parameter metadata not available for the given statement
;
java.sql.SQLException: Parameter metadata not available for the given statement
!ENTRY org.eclipse.birt.data 4 1001 2011-09-09 16:04:04.721
!MESSAGE A BIRT exception occurred.
!STACK 0
org.eclipse.birt.data.engine.core.DataException: Failed to prepare the query execution for the data set: OrdersInDateRangeForOrderStatus
Cannot set a null value to parameter 3.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1: Parameter metadata not available for the given statement
;
java.sql.SQLException: Parameter metadata not available for the given statement
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:344)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:448)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:145)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:159)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:142)
at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:136)
at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:118)
at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:102)
at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getRuntimeMetaData(DataSetMetaDataHelper.java:193)
at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getRealMetaData(DataSetMetaDataHelper.java:152)
at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getDataSetMetaData(DataSetMetaDataHelper.java:114)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.getDataSetMetaData(DataRequestSessionImpl.java:232)
at org.eclipse.birt.report.designer.data.ui.util.DataSetProvider.populateAllOutputColumns(DataSetProvider.java:206)
at org.eclipse.birt.report.designer.data.ui.dataset.OutputColumnsPage.populateOutputColums(OutputColumnsPage.java:365)
at org.eclipse.birt.report.designer.data.ui.dataset.OutputColumnsPage.updateOutputColumns(OutputColumnsPage.java:312)
at org.eclipse.birt.report.designer.data.ui.dataset.OutputColumnsPage.pageActivated(OutputColumnsPage.java:215)
at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog.showPage(AbstractPropertyDialog.java:584)
at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog.showSelectionPage(AbstractPropertyDialog.java:482)
at org.eclipse.birt.report.designer.data.ui.dataset.DataSetEditor.showSelectionPage(DataSetEditor.java:903)
at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog$2$1.run(AbstractPropertyDialog.java:438)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog$2.selectionChanged(AbstractPropertyDialog.java:433)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2162)
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1190)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1220)
at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:228)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:222)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:389)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.birt.report.designer.ui.dialogs.BaseDialog.open(BaseDialog.java:111)
at org.eclipse.birt.report.designer.data.ui.providers.EditableDataSetNodeProvider.performEdit(EditableDataSetNodeProvider.java:99)
at org.eclipse.birt.report.designer.internal.ui.views.DefaultNodeProvider.performRequest(DefaultNodeProvider.java:442)
at org.eclipse.birt.report.designer.internal.ui.views.actions.EditAction.doAction(EditAction.java:90)
at org.eclipse.birt.report.designer.internal.ui.views.actions.AbstractElementAction.run(AbstractElementAction.java:70)
at org.eclipse.birt.report.designer.internal.ui.views.RenameListener.doubleClick(RenameListener.java:214)
at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:824)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:822)
at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1421)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1225)
at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:238)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:235)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:296)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.birt.report.designer.ui.rcp.DesignerApplication.run(DesignerApplication.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Caused by: org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot set a null value to parameter 3.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1: Parameter metadata not available for the given statement
;
java.sql.SQLException: Parameter metadata not available for the given statement
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.newException(ExceptionHandler.java:54)
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:108)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetNull(PreparedStatement.java:4651)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setNull(PreparedStatement.java:4173)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3113)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:982)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:555)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:285)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:441)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:340)
... 85 more
Caused by: org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1: Parameter metadata not available for the given statement
;
java.sql.SQLException: Parameter metadata not available for the given statement
at org.eclipse.birt.report.data.oda.jdbc.Statement.setNull(Statement.java:869)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.setNull(OdaQuery.java:1207)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetNull(PreparedStatement.java:4646)
... 93 more
Caused by: java.sql.SQLException: Parameter metadata not available for the given statement
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.MysqlParameterMetadata.checkAvailable(MysqlParameterMetadata.java:69)
at com.mysql.jdbc.MysqlParameterMetadata.getParameterType(MysqlParameterMetadata.java:118)
at org.eclipse.birt.report.data.oda.jdbc.Statement.setNull(Statement.java:864)
... 95 more
!SUBENTRY 1 org.eclipse.birt.data 1 1001 2011-09-09 16:04:04.722
!MESSAGE Plug-in Provider:Eclipse.org
!SUBENTRY 1 org.eclipse.birt.data 1 1001 2011-09-09 16:04:04.722
!MESSAGE Plug-in Name:BIRT Data Engine
!SUBENTRY 1 org.eclipse.birt.data 1 1001 2011-09-09 16:04:04.722
!MESSAGE Plug-in ID:org.eclipse.birt.data
!SUBENTRY 1 org.eclipse.birt.data 1 1001 2011-09-09 16:04:04.722
!MESSAGE Version:2.6.1.v20100915
!SUBENTRY 1 org.eclipse.birt.data 4 1001 2011-09-09 16:04:04.722
!MESSAGE Error Code:data.engine.fail.prepareExecution
!SUBENTRY 1 org.eclipse.birt.data 4 1001 2011-09-09 16:04:04.722
!MESSAGE Error Message:Failed to prepare the query execution for the data set: OrdersInDateRangeForOrderStatus
Cannot set a null value to parameter 3.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1: Parameter metadata not available for the given statement
;
java.sql.SQLException: Parameter metadata not available for the given statement
</pre>
<br />
Any ideas on this? Am I missing some configuration or something?
Find more posts tagged with
Comments
mwilliams
I don't see an issue with the setup at first glance. It would help if I could run the report and see the data though. Is there any way you can reproduce this with the sample database? Or does this only happen with this report?
DispatchMG
Umm, I'm not sure if it's reproducible in that respect. Do you have a link to/for the database you're talking about and I can try to reproduce it with that? Also, using the RCP (stand-alone) version of BIRT designer, do you know how to enable logging such that I could see the SQL being generated and used to query the database?
mwilliams
The sample database is a standard feature of BIRT. If you go to make a new dataSource, there is a classic models database that you can make sample reports off of to help with working through issues. This way we have a common database to make reports out of to share.
DispatchMG
Okay, so I got pulled aside to tackle some higher priority issues at work, but now I'm back on the report horse. So, I'm back looking at the issues I had put in, and part of that was moving my problems to a report that uses the BIRT sample database so that others can replicate what I'm seeing and experiencing.<br />
<br />
So, with all of that said, I created a test report using the sample database. With this report, I want to pull a list of products from the ClassicCars database. Easy enough, so I added a small twist: the list of products can now be filtered based on ProductLine. So, I created another data source, set up a drop-down box parameter that pulls from that ProductLine data source.<br />
<br />
I want this parameter to be optional; that is, they can select from the drop-down or choose a null value. I know that this means I will have write a small bit of ode in the beforeOpen script, which I've done as follows:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if (params["product_line"] != null && params["product_line"] != 'null' && params["product_line"] != "null")
{
this.queryText += " where CLASSICMODELS.PRODUCTS.PRODUCTLINE='" + params["product_line"] + "'";
}
QT = this.queryText;
</pre>
<br />
The two issues I've created in these forums are both encapsulated in this report sample:<br />
<br />
<ul class='bbcol decimal'><li>My <span style='font-family: Courier New'>if</span> statement doesn't seem to catch null values as I would like, thus causing my SQL to always be incorrect.</li><li>I cannot get the drop-down to appear unless I mark it as 'Required', which I do not want it to be.</li></ul>
<br />
If I could get some assistance with these issues I've outlined above, I would be very appreciative. Then once I can get this working, I should be able to apply the same lessons learned to my production reports and get them working. Thanks to all for your help.
johnw
Scott Rosenbaum wrote an article about doing this at:
http://birtworld.blogspot.com/2009/04/multi-select-parameters-part-2.html
There are some comments in the body of the post that point to alternate methods.