private void changeCreditStatus(int creditStatus) {
    
        final int indexColumnName = 0;
        final int indexColumnStatus = 3;
        
        int selectedRowIndex = creditTable.getSelectedRow();
        
        if (creditStatus == -1) {
            String status = String.valueOf(creditTable.getValueAt(selectedRowIndex, indexColumnStatus));
            
            if (status.equals(CreditDAO.activeStatus)) {
                JOptionPane.showMessageDialog(this, "Отменить активную заявку невозможно!");
                return;
            }
        }
        String programName = String.valueOf(creditTable.getValueAt(selectedRowIndex, indexColumnName));
        
        CreditProgram crProg = crProgDAO.get(programName);
        int selectedProgramId = crProg.getId();
        Statement statement = null;
        ResultSet result = null;
        try {
            statement = creditDAO.getConnection().createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
            result = statement.executeQuery(creditDAO.getAllQuery());
            
            while (result.next()) {
                if ((result.getInt("CLIENTSID") == clientId) &&
                        (result.getInt("CREDITPROGRAMID") == selectedProgramId)) {
                    break;
                }
            }
            result.updateInt("CREDITSTATUS", creditStatus);
            result.updateRow();

            if (creditStatus == 1) {
                JOptionPane.showMessageDialog(this, "Заявка активна");
            } else {
                JOptionPane.showMessageDialog(this, "Заявка отклонена");
            }
            creditDAO.initTableModel(creditTable, creditDAO.getCreditsByClientsId(clientId));
        } catch (SQLException exc) {
            System.out.println("Ошибка при изменении данных!");
        }
    }