我在用eclipse写java 程序,我现在用sqlserver有两个问题!
一是  to_date方法,我用参数,但是总是报错,不知道什么原因。
二是 我在修改数据库后,刷新,报错rows update failed,用oracle没问题!

解决方案 »

  1.   

    date如果导入的是java.sql.Date是需要参数的,如果导入的java.util.Date的话是不需要参数的
      

  2.   


    对sqlserver用result.updateRow();更新数据库显示如下的错误,而我用oracle时并没有抱错,各位大哥有没有碰到过这样的问题 阿,给小弟指导一下 谢了阿 java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Row update failed.
     at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
     at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
     at com.microsoft.jdbc.base.BaseImplUpdatableResultSet.executeStatement(Unknown Source)
     at com.microsoft.jdbc.base.BaseImplUpdatableResultSet.updateRow(Unknown Source)
     at com.microsoft.jdbc.base.BaseResultSet.updateRow(Unknown Source)
     at com.inspur.main.view.UserListTableModel.setValueAt(UserListTableModel.java:174)
     at javax.swing.JTable.setValueAt(Unknown Source)
     at javax.swing.JTable.editingStopped(Unknown Source)
     at javax.swing.AbstractCellEditor.fireEditingStopped(Unknown Source)
     at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(Unknown Source)
     at javax.swing.DefaultCellEditor.stopCellEditing(Unknown Source)
     at javax.swing.JTable$GenericEditor.stopCellEditing(Unknown Source)
     at javax.swing.plaf.basic.BasicTableUI$Handler.mousePressed(Unknown Source)
     at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
     at java.awt.Component.processMouseEvent(Unknown Source)
     at javax.swing.JComponent.processMouseEvent(Unknown Source)
     at java.awt.Component.processEvent(Unknown Source)
     at java.awt.Container.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Window.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)