Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Derby 我的删除按钮不工作无效光标状态-无当前行_Derby_Netbeans 8 - Fatal编程技术网

Derby 我的删除按钮不工作无效光标状态-无当前行

Derby 我的删除按钮不工作无效光标状态-无当前行,derby,netbeans-8,Derby,Netbeans 8,删除按钮不工作它说无效的光标状态-没有当前行,源代码中没有错误代码中缺少代码为什么不工作 private void DeleteActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: try { int confirmed = JOptionPane.showCon

删除按钮不工作它说无效的光标状态-没有当前行,源代码中没有错误代码中缺少代码为什么不工作

private void DeleteActionPerformed(java.awt.event.ActionEvent evt) {                                       
    // TODO add your handling code here:
       try {
        int confirmed = JOptionPane.showConfirmDialog(null, "Are you 
   sure you want to delete the records?","Delete Button Message 
   Box",JOptionPane.YES_NO_OPTION);
        if(confirmed == JOptionPane.YES_OPTION)
        {
        JOptionPane.showMessageDialog(StockPage.this, "Record Deleted");
        rs.deleteRow();
        stmt.close();
        rs.close();
        stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
        String sql = "SELECT * FROM STOCKNEW";
        rs = stmt.executeQuery(sql);
                   rs.next();
    int id_col = rs.getInt("ITEM");
    String id = Integer.toString(id_col);
    String description = rs.getString("DESCRIPTION");
    String amt = rs.getString("AMOUNT");

    update_table();
    TextItem.setText(id);
    TextDescription.setText(description);
    TextAmount.setText(amt);

    
        }else {
            JOptionPane.showMessageDialog(StockPage.this, "Records was not Deleted");
        }

        }
    catch(SQLException err) {
        JOptionPane.showMessageDialog(StockPage.this, err.getMessage());
    }
}                                      


}                                    

试着一次只关注一件坏掉的东西……好吧,等等,我来编辑它