已有101人关注
java项目开发全程实录进销售管理系统的入库问题
发表在Java图书答疑 2011-02-25
是否精华
版块置顶:
  在进货单界面里添加商品信息后按入库入库按钮出现以下问题:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]插入错误: 列名或所提供值的数目与表定义不匹配。
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.execute(Unknown Source)
at com.lzw.dao.Dao.insert(Dao.java:346)
at com.lzw.dao.Dao.insertRukuInfo(Dao.java:288)
at internalFrame.JinHuoDan$RkActionListener.actionPerformed(JinHuoDan.java:262)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
但会出现“入库完成”提示框,我随后在查询分析器查了tb_ruku_main,tb_ruku_detail,tb_kucun这三个表,
发现入库主表插入了记录,库存表的单价和数量也是正确的,

 那个入库明细表insert("insert into tb_ruku_detail values('" + ruMain.getRkId()
+ "','" + details.getTabSpinfo() + "',"
+ details.getDj() + "," + details.getSl() + ")");
这里是不是少插入了一个入库明细表的id字段呀,是的话,怎么获取?
分享到:
精彩评论 4
ccbwm
学分:0 LV1
TA的每日心情
开心
2022-10-30 14:26:53
2011-02-25
沙发
[FIELDSET][LEGEND]引自:楼主[/LEGEND]
  在进货单界面里添加商品信息后按入库入库按钮出现以下问题:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]插入错误: 列名或所提供值的数目与表定义不匹配。
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.execute(Unknown Source)
at com.lzw.dao.Dao.insert(Dao.java:346)
at com.lzw.dao.Dao.insertRukuInfo(Dao.java:288)
at internalFrame.JinHuoDan$RkActionListener.actionPerformed(JinHuoDan.java:262)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
但会出现“入库完成”提示框,我随后在查询分析器查了tb_ruku_main,tb_ruku_detail,tb_kucun这三个表,
发现入库主表插入了记录,库存表的单价和数量也是正确的,

 那个入库明细表insert("insert into tb_ruku_detail values('" + ruMain.getRkId()
+ "','" + details.getTabSpinfo() + "',"
+ details.getDj() + "," + details.getSl() + ")");
这里是不是少插入了一个入库明细表的id字段呀,是的话,怎么获取?
[/FIELDSET]

回复:
  字表ID可以在数据库里设置自增,不用人工保存
longyuyuehaoya
学分:0 LV1
TA的每日心情
开心
2022-02-12 22:36:01
2011-02-25
板凳
   怎样在数据库里设置字表ID的自增
longyuyuehaoya
学分:0 LV1
TA的每日心情
开心
2022-02-12 22:36:01
2011-02-25
地板
  可以了,谢谢!
东北虎
学分:0 LV1
2011-03-08
4L
结贴
首页上一页 1 下一页尾页 4 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照