我正在尝试将 XPagesJDBC.nsf 连接到一个简单的 MS Access 数据库,它成功连接并且我能够执行 @JdbcInsert、更新、删除。还能够执行 SQL 查询操作。
但是我在尝试使用 JDBC Query 数据源类型在 ViewPanel 控件中显示数据时遇到了问题。
它给出以下错误
Error while reading the relational data
Invalid Fetch Size
还有一个很长的 StackTrace,我正在复制下面的堆栈跟踪的一部分;
我认为这个错误是特定于 MS Access 的,因为我可以在其他 RDBMS 中找到一些成功的实现,它也可以在我的末尾使用“durby”正常工作。
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:840)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.component.UIViewRootEx._renderView(UIViewRootEx.java:1317)
com.ibm.xsp.component.UIViewRootEx.renderView(UIViewRootEx.java:1255)
com.ibm.xsp.application.ViewHandlerExImpl.doRender(ViewHandlerExImpl.java:641)
com.ibm.xsp.application.ViewHandlerExImpl._renderView(ViewHandlerExImpl.java:320)
com.ibm.xsp.application.ViewHandlerExImpl.renderView(ViewHandlerExImpl.java:335)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:103)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:264)
com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:248)
com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:200)
com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:137)
com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1267)
com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)
com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1251)
com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:598)
com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:421)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)
com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
java.sql.SQLException: Invalid Fetch Size
sun.jdbc.odbc.JdbcOdbcStatement.setFetchSize(JdbcOdbcStatement.java:838)
sun.jdbc.odbc.JdbcOdbcResultSet.setFetchSize(JdbcOdbcResultSet.java:2987)
com.ibm.xsp.extlib.jdbc.model.JdbcDataBlockAccessor.loadBlock(JdbcDataBlockAccessor.java:389)
com.ibm.xsp.extlib.model.DataBlockAccessor.findBlockByIndex(DataBlockAccessor.java:344)
com.ibm.xsp.extlib.model.DataBlockAccessor.prefetchData(DataBlockAccessor.java:292)
com.ibm.xsp.extlib.model.DataAccessorModel.getRowCount(DataAccessorModel.java:93)
com.ibm.xsp.component.UIPager$PagerState.<init>(UIPager.java:76)
com.ibm.xsp.component.UIPager$PagerState.<init>(UIPager.java:71)
com.ibm.xsp.component.UIPager.createPagerState(UIPager.java:540)
com.ibm.xsp.renderkit.html_extended.XPagerRenderer.encodeChildren(XPagerRenderer.java:67)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(ReadOnlyAdapterRenderer.java:162)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:979)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:842)
com.ibm.xsp.renderkit.html_extended.ViewPanelRenderer.processPagerCell(ViewPanelRenderer.java:656)
com.ibm.xsp.renderkit.html_extended.ViewPanelRenderer.encodeBegin(ViewPanelRenderer.java:354)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeBegin(ReadOnlyAdapterRenderer.java:146)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:956)
javax.faces.component.UIData.encodeBegin(UIData.java:788)
com.ibm.xsp.component.UIDataEx.encodeBegin(UIDataEx.java:413)
com.ibm.xsp.component.UIViewPanel.encodeBegin(UIViewPanel.java:288)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:840)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:851)
myconnection.jdbc 文件;ext_db 是一个 DSN
<jdbc>
<driver>sun.jdbc.odbc.JdbcOdbcDriver</driver>
<url>jdbc:odbc:ext_db</url>
<user>xxx</user>
<password>xxx</password>
</jdbc>