private void CalculateAttackSuccessButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CalculateAttackSuccessButtonActionPerformed
    PreparedStatement ps_update = null;
    Connection conn = null;

    try {
        if ((conn = JavaDBAccess.setConn()) != null) {
            System.out.println("Connected to database " + JavaDBAccess.getDatabaseName());
        } else {
            throw new Exception("Not connected to database " + JavaDBAccess.getDatabaseName());
        }

        conn.setAutoCommit(false);

        ps_update = conn.prepareStatement("UPDATE ATTACK_PAYLOADS SET ATTACK_RESULT='SUCCESSFUL' WHERE EXISTS (SELECT 1 FROM MYSQL_QUERIES Q1,MYSQL_PROXY_PACKETS P1,MYSQL_QUERIES Q2,MYSQL_PROXY_PACKETS P2 WHERE Q1.MYSQL_PROXY_PACKET_CLIENT=P1.ID AND P1.TARGET_PHP_FILES_RUNS_FUNCTION=ATTACK_PAYLOADS.TARGET_PHP_FILES_RUNS_FUNCTION AND Q2.MYSQL_PROXY_PACKET_CLIENT=P2.ID AND P2.TARGET_PHP_FILES_RUNS_FUNCTION=ATTACK_PAYLOADS.ATTACK_TARGET_PHP_FILES_RUNS_FUNCTION AND P1.HTTP_PACKET_SEQUENCE=P2.HTTP_PACKET_SEQUENCE AND Q1.MYSQL_QUERY_SEQUENCE=Q2.MYSQL_QUERY_SEQUENCE AND Q1.SQL_COMMAND_STRUCTURE <> Q2.SQL_COMMAND_STRUCTURE) AND ATTACK_RESULT='UNDEFINED'");
        ps_update.executeUpdate();
        conn.commit();
        ps_update = conn.prepareStatement("UPDATE ATTACK_PAYLOADS SET ATTACK_RESULT='NOT SUCCESSFUL' WHERE EXISTS (SELECT 1 FROM MYSQL_QUERIES Q1,MYSQL_PROXY_PACKETS P1,MYSQL_QUERIES Q2,MYSQL_PROXY_PACKETS P2 WHERE Q1.MYSQL_PROXY_PACKET_CLIENT=P1.ID AND P1.TARGET_PHP_FILES_RUNS_FUNCTION=ATTACK_PAYLOADS.TARGET_PHP_FILES_RUNS_FUNCTION AND Q2.MYSQL_PROXY_PACKET_CLIENT=P2.ID AND P2.TARGET_PHP_FILES_RUNS_FUNCTION=ATTACK_PAYLOADS.ATTACK_TARGET_PHP_FILES_RUNS_FUNCTION AND P1.HTTP_PACKET_SEQUENCE=P2.HTTP_PACKET_SEQUENCE AND Q1.MYSQL_QUERY_SEQUENCE=Q2.MYSQL_QUERY_SEQUENCE AND Q1.SQL_COMMAND_STRUCTURE = Q2.SQL_COMMAND_STRUCTURE) AND ATTACK_RESULT='UNDEFINED'");
        ps_update.executeUpdate();
        ps_update.close();
        conn.commit();
        ps_update = conn.prepareStatement("UPDATE ATTACK_PAYLOADS SET IDS_COMMAND_DETECTION_RESULT='NOT SUCCESSFUL' WHERE IDS_COMMAND_DETECTION_RESULT='UNDEFINED'");
        ps_update.executeUpdate();
        ps_update.close();
        conn.commit();
        if (UseIDSRadioButton.isSelected()) {
            ps_update = conn.prepareStatement("UPDATE ATTACK_PAYLOADS SET IDS_COMMAND_DETECTION_RESULT='SUCCESSFUL' WHERE UPPER(IDS_RESULT) LIKE '%MALICIOUS_COMMAND%'");
            ps_update.executeUpdate();
            ps_update.close();
            conn.commit();
            ps_update = conn.prepareStatement("UPDATE ATTACK_PAYLOADS SET IDS_TRANSACTION_DETECTION_RESULT='NOT SUCCESSFUL' WHERE IDS_TRANSACTION_DETECTION_RESULT='UNDEFINED'");
            ps_update.executeUpdate();
            ps_update.close();
            conn.commit();
            ps_update = conn.prepareStatement("UPDATE ATTACK_PAYLOADS SET IDS_TRANSACTION_DETECTION_RESULT='SUCCESSFUL' WHERE UPPER(IDS_RESULT) LIKE '%MALICIOUS_TRANSACTION%'");
            ps_update.executeUpdate();
            ps_update.close();
            conn.commit();
        }
        conn.close();

    } catch (Throwable e) {
        System.out.println("Errors in ParsePHPFile!");
        System.out.println("exception thrown:");

        if (e instanceof SQLException) {
            JavaDBAccess.printSQLError((SQLException) e);
        } else {
            e.printStackTrace();
        }
    }
}