当前位置: 代码迷 >> Java相关 >> 向数据库里添加时出错
  详细解决方案

向数据库里添加时出错

热度:257   发布时间:2013-04-18 20:52:44.0
向数据库里添加时出错
老师叫做一个项目,我在做到向数据库里更新信息的时候无法更细出现以下问题:


菜品名称:土豆丝
菜品规格:盘
菜品价格:12
菜品类型:中餐
2013-4-18 20:46:38 edu.sdp.cater.order.Dish addDish
严重: null
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:171)
    at edu.sdp.cater.order.Dish.addDish(Dish.java:40)
    at edu.sdp.cater.frame.DishAddJFrame.jButton1ActionPerformed(DishAddJFrame.java:156)
    at edu.sdp.cater.frame.DishAddJFrame.access$000(DishAddJFrame.java:13)
    at edu.sdp.cater.frame.DishAddJFrame$1.actionPerformed(DishAddJFrame.java:65)
    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:6297)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)
    at java.awt.Component.processEvent(Component.java:6062)
    at java.awt.Container.processEvent(Container.java:2039)
    at java.awt.Component.dispatchEventImpl(Component.java:4660)
    at java.awt.Container.dispatchEventImpl(Container.java:2097)
    at java.awt.Component.dispatchEvent(Component.java:4488)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
    at java.awt.Container.dispatchEventImpl(Container.java:2083)[/color]




这是怎么回事啊!!!!求大神啊!数据库是sql
搜索更多相关的解决方案: 数据库  土豆丝  规格  

----------------解决方案--------------------------------------------------------
com.microsoft.sqlserver.jdbc.SQLServerDriver
很明显是找不到数据库的驱动,你先看看你有没有导入sql的驱动jar
如果不是 就看看你的sql版本(这很重要) 版本不一样  com.microsoft.sqlserver.jdbc.SQLServerDriver《--也是不一样的

----------------解决方案--------------------------------------------------------
回复 2楼 hhwz
嗯嗯
----------------解决方案--------------------------------------------------------
  相关解决方案