当前位置: 技术问答>java相关
JBuilder数据库编程出错!???
来源: 互联网 发布时间:2017-04-19
本文导语: 使用 QueryDataSet + jdbTable 编写了一个简单的数据库访问程序,可以读取数据显示到jdbTable上了,也可以在jdbTable上编辑修改数据,可是一按jdbNavToolBar上的save change键,就会弹出出错窗口,Stack Trace如下: See com.bor...
使用 QueryDataSet + jdbTable 编写了一个简单的数据库访问程序,可以读取数据显示到jdbTable上了,也可以在jdbTable上编辑修改数据,可是一按jdbNavToolBar上的save change键,就会弹出出错窗口,Stack Trace如下:
See com.borland.dx.sql.dataset.ResolutionException error code: BASE+3
com.borland.dx.sql.dataset.ResolutionException: An error occurred saving a change to the "product" table
at com.borland.dx.sql.dataset.ResolutionException.a(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionException.c(Unknown Source)
at com.borland.dx.sql.dataset.l.a(Unknown Source)
at com.borland.dx.sql.dataset.QueryResolver.updateRow(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.a(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.e(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.e(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.Database.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.saveChanges(Unknown Source)
at com.borland.dx.dataset.DataSet.saveChanges(Unknown Source)
at com.borland.dbswing.JdbNavToolBar.actionPerformed(JdbNavToolBar.java:1799)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1445)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1499)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:373)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:211)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:225)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:225)
at java.awt.Component.processMouseEvent(Component.java:3710)
at java.awt.Component.processEvent(Component.java:3539)
at java.awt.Container.processEvent(Container.java:1159)
at java.awt.Component.dispatchEventImpl(Component.java:2588)
at java.awt.Container.dispatchEventImpl(Container.java:1208)
at java.awt.Component.dispatchEvent(Component.java:2492)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
at java.awt.Container.dispatchEventImpl(Container.java:1195)
at java.awt.Window.dispatchEventImpl(Window.java:921)
at java.awt.Component.dispatchEvent(Component.java:2492)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:126)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
Chained exception:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value can not be converted to requested type.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseData.getBigDecimal(Unknown Source)
at com.microsoft.jdbc.base.BaseData.getBigDecimal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.setObject(Unknown Source)
at com.borland.dx.sql.dataset.j.setParameter(Unknown Source)
at com.borland.dx.sql.dataset.a.a(Unknown Source)
at com.borland.dx.sql.dataset.l.a(Unknown Source)
at com.borland.dx.sql.dataset.QueryResolver.updateRow(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.a(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.e(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.e(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.Database.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.saveChanges(Unknown Source)
at com.borland.dx.dataset.DataSet.saveChanges(Unknown Source)
at com.borland.dbswing.JdbNavToolBar.actionPerformed(JdbNavToolBar.java:1799)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1445)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1499)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:373)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:211)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:225)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:225)
at java.awt.Component.processMouseEvent(Component.java:3710)
at java.awt.Component.processEvent(Component.java:3539)
at java.awt.Container.processEvent(Container.java:1159)
at java.awt.Component.dispatchEventImpl(Component.java:2588)
at java.awt.Container.dispatchEventImpl(Container.java:1208)
at java.awt.Component.dispatchEvent(Component.java:2492)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
at java.awt.Container.dispatchEventImpl(Container.java:1195)
at java.awt.Window.dispatchEventImpl(Window.java:921)
at java.awt.Component.dispatchEvent(Component.java:2492)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:126)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
这是怎么回事呀? 谁可以救救我呀???? :((
See com.borland.dx.sql.dataset.ResolutionException error code: BASE+3
com.borland.dx.sql.dataset.ResolutionException: An error occurred saving a change to the "product" table
at com.borland.dx.sql.dataset.ResolutionException.a(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionException.c(Unknown Source)
at com.borland.dx.sql.dataset.l.a(Unknown Source)
at com.borland.dx.sql.dataset.QueryResolver.updateRow(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.a(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.e(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.e(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.Database.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.saveChanges(Unknown Source)
at com.borland.dx.dataset.DataSet.saveChanges(Unknown Source)
at com.borland.dbswing.JdbNavToolBar.actionPerformed(JdbNavToolBar.java:1799)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1445)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1499)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:373)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:211)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:225)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:225)
at java.awt.Component.processMouseEvent(Component.java:3710)
at java.awt.Component.processEvent(Component.java:3539)
at java.awt.Container.processEvent(Container.java:1159)
at java.awt.Component.dispatchEventImpl(Component.java:2588)
at java.awt.Container.dispatchEventImpl(Container.java:1208)
at java.awt.Component.dispatchEvent(Component.java:2492)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
at java.awt.Container.dispatchEventImpl(Container.java:1195)
at java.awt.Window.dispatchEventImpl(Window.java:921)
at java.awt.Component.dispatchEvent(Component.java:2492)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:126)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
Chained exception:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value can not be converted to requested type.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseData.getBigDecimal(Unknown Source)
at com.microsoft.jdbc.base.BaseData.getBigDecimal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.setObject(Unknown Source)
at com.borland.dx.sql.dataset.j.setParameter(Unknown Source)
at com.borland.dx.sql.dataset.a.a(Unknown Source)
at com.borland.dx.sql.dataset.l.a(Unknown Source)
at com.borland.dx.sql.dataset.QueryResolver.updateRow(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.a(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.e(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.e(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.ResolutionManager.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.Database.saveChanges(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.saveChanges(Unknown Source)
at com.borland.dx.dataset.DataSet.saveChanges(Unknown Source)
at com.borland.dbswing.JdbNavToolBar.actionPerformed(JdbNavToolBar.java:1799)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1445)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1499)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:373)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:245)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:211)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:225)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:225)
at java.awt.Component.processMouseEvent(Component.java:3710)
at java.awt.Component.processEvent(Component.java:3539)
at java.awt.Container.processEvent(Container.java:1159)
at java.awt.Component.dispatchEventImpl(Component.java:2588)
at java.awt.Container.dispatchEventImpl(Container.java:1208)
at java.awt.Component.dispatchEvent(Component.java:2492)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2446)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2211)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2120)
at java.awt.Container.dispatchEventImpl(Container.java:1195)
at java.awt.Window.dispatchEventImpl(Window.java:921)
at java.awt.Component.dispatchEvent(Component.java:2492)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:126)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
这是怎么回事呀? 谁可以救救我呀???? :((
|
你的querydataset的sql是从一个表里取数据嘛?如果从多个表取数据可能会有问题